Skip to content

Commit 45087f3

Browse files
committed
for #362
1 parent 6e4d601 commit 45087f3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lua/easycomplete/cmdline.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ local function bind_cmdline_event()
139139
end)
140140
end
141141

142-
function normalize_list(arr)
142+
function normalize_list(arr, word)
143143
if #arr == 0 then return arr end
144144
local ret = {}
145145
for index, value in ipairs(arr) do
@@ -148,11 +148,9 @@ function normalize_list(arr)
148148
abbr = arr[index],
149149
kind = vim.g.easycomplete_kindflag_cmdline,
150150
menu = vim.g.easycomplete_menuflag_cmdline,
151-
marked_position = {0},
152-
abbr_marked = "§" .. string.sub(arr[index], 1, 1) .. "§" .. string.sub(arr[index], 2)
153151
})
154152
end
155-
return ret
153+
return vim.fn['easycomplete#util#CompleteMenuFilter'](ret, word, 500)
156154
end
157155

158156
function cmdline_handler(keys, key_str)
@@ -179,7 +177,7 @@ function cmdline_handler(keys, key_str)
179177
local menu_items = vim.fn.getcompletion(word, "function")
180178
local start_col = vim.fn.getcmdpos() - calculate_sign_and_linenr_width() - #word
181179
cmdline_start_cmdpos = vim.fn.getcmdpos() - #word
182-
pum_complete(start_col, normalize_list(menu_items))
180+
pum_complete(start_col, normalize_list(menu_items, word))
183181
end
184182
vim.cmd("redraw")
185183
end

0 commit comments

Comments
 (0)