Skip to content

Commit 79456dc

Browse files
committed
Fix #45
Fix #46
1 parent e1ba818 commit 79456dc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lua/cmp_cmdline/init.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ local MODIFIER_REGEX = create_regex({
2929
}, true)
3030

3131
local COUNT_RANGE_REGEX = create_regex({
32-
[=[\s*\%(\d\+\|\$\),\%(\d\+\|\$\)\s*]=],
33-
[=[\s*'<,'>\s*]=],
32+
[=[\s*\%(\d\+\|\$\)\%[,\%(\d\+\|\$\)]\s*]=],
33+
[=[\s*'\%[<,'>]\s*]=],
3434
[=[\s*\%(\d\+\|\$\)\s*]=],
3535
}, true)
3636

@@ -73,9 +73,10 @@ local definitions = {
7373
-- Support `lua vim.treesitter._get|` or `'<,'>del|` completion.
7474
-- In this case, the `vim.fn.getcompletion` will return only `get_query` for `vim.treesitter.get_|`.
7575
-- We should detect `vim.treesitter.` and `get_query` separately.
76+
-- TODO: The `\h\w*` was choosed by huristic. We should consider more suitable detection.
7677
local fixed_input
7778
do
78-
local suffix_pos = vim.regex([[\k*$]]):match_str(arglead)
79+
local suffix_pos = vim.regex([[\h\w*$]]):match_str(arglead)
7980
fixed_input = string.sub(arglead, 1, suffix_pos or #arglead)
8081
end
8182

0 commit comments

Comments
 (0)