Skip to content

Commit 7f5ef0f

Browse files
committed
fix(cmdline): translate mappings for use with :map
1 parent 8cd3740 commit 7f5ef0f

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
@@ -219,6 +219,12 @@ function cmdline:get_completions(context, callback)
219219
option_info = self.options[completion]
220220
if option_info then label_details = { description = option_info.shortname } end
221221

222+
-- mappings
223+
elseif completion_type == 'mapping' then
224+
completion = completion:gsub('\22', '') -- remove control characters
225+
completion = vim.fn.keytrans(completion):gsub('<lt>', '<')
226+
filter_text, new_text = completion, completion
227+
222228
-- env variables
223229
elseif completion_type == 'environment' then
224230
filter_text = '$' .. completion

0 commit comments

Comments
 (0)