Skip to content

Commit 0d6b66d

Browse files
committed
add options support for cmdline
1 parent 7bec73e commit 0d6b66d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lua/easycomplete/cmdline.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,23 @@ this.REG_CMP_HANDLER = {
530530
end
531531
end
532532
},
533+
{
534+
-- 输入 options
535+
pattern = {
536+
'^[a-zA-Z0-9_]+%s&$', -- 输入命令完毕后,空格&匹配option: `echo &|`
537+
'^[a-zA-Z0-9_]+%s+&%w+$', -- 匹配 options 过程中: `echo &e|`
538+
'^[a-zA-Z0-9_]+%s+.+&$', -- 匹配 options 过程中:`echo &filetype . &|`
539+
'^[a-zA-Z0-9_]+%s+.+&%w+$' -- 匹配 options 过程中:`echo &filetype . &file|`
540+
},
541+
get_cmp_items = function()
542+
if this.insearch() then
543+
return this.get_normal_search_cmp()
544+
else
545+
local options = this.NATIVE_OPTIONS
546+
return options
547+
end
548+
end
549+
},
533550
{
534551
pattern = {
535552
"^[a-zA-Z0-9_]+%s$", -- 命令输入完毕,并敲击空格

0 commit comments

Comments
 (0)