Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/blink/cmp/config/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
--- | 'scroll_signature_down' Scroll the signature window down
--- | 'snippet_forward' Move the cursor forward to the next snippet placeholder
--- | 'snippet_backward' Move the cursor backward to the previous snippet placeholder
--- | (fun(cmp: blink.cmp.API): boolean?) Custom function where returning true will prevent the next command from running
--- | (fun(cmp: blink.cmp.API): string? | boolean?) Custom function where returning true will prevent the next command from running. Returning a string will insert the literal characters

--- @alias blink.cmp.KeymapPreset
--- | 'none' No keymaps
Expand Down
4 changes: 3 additions & 1 deletion lua/blink/cmp/keymap/apply.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ function apply.keymap_to_current_buffer(keys_to_commands)

-- run user defined functions
elseif type(command) == 'function' then
if command(require('blink.cmp')) then return end
local ret = command(require('blink.cmp'))
if type(ret) == 'string' then return ret end
if ret then return end

-- otherwise, run the built-in command
elseif require('blink.cmp')[command]() then
Expand Down