Skip to content

Commit 7770a67

Browse files
committed
fix(cmdline): translate mappings for use with :map
Closes #2126
1 parent 7b0548e commit 7770a67

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/blink/cmp/sources/cmdline/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ function cmdline:get_completions(context, callback)
244244
option_info = self.options[completion]
245245
if option_info then label_details = { description = option_info.shortname } end
246246

247+
-- mappings
248+
elseif completion_type == 'mapping' then
249+
completion = completion:gsub('\22', '') -- remove control characters
250+
completion = vim.fn.keytrans(completion):gsub('<lt>', '<')
251+
filter_text, new_text = completion, completion
252+
247253
-- env variables
248254
elseif completion_type == 'environment' then
249255
filter_text = '$' .. completion

0 commit comments

Comments
 (0)