Skip to content

Commit

Permalink
feat: disable keymaps when no cmdline sources are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 12, 2024
1 parent 342c5ed commit 88ec601
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/blink/cmp/keymap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ function keymap.setup()
require('blink.cmp.keymap.apply').keymap_to_current_buffer(mappings)
end

-- Always apply cmdline keymaps since they're global
require('blink.cmp.keymap.apply').cmdline_keymaps(mappings)
-- Apply cmdline keymaps since they're global, if any sources are defined
local cmdline_sources = require('blink.cmp.config').sources.cmdline
if type(cmdline_sources) ~= 'table' or #cmdline_sources > 0 then
require('blink.cmp.keymap.apply').cmdline_keymaps(mappings)
end
end

return keymap

0 comments on commit 88ec601

Please sign in to comment.