Commit 487bc70 1 parent eec6019 commit 487bc70 Copy full SHA for 487bc70
File tree 1 file changed +4
-3
lines changed
lua/null-ls/builtins/completion
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ local methods = require("null-ls.methods")
4
4
local COMPLETION = methods .internal .COMPLETION
5
5
6
6
-- based on pattern from cmp-luasnip
7
- local pattern = " \\ %([^[:alnum:][:blank:]]\\ +\\ |\\ w\\ +\\ )"
8
- local regex = vim .regex ([[ \%(]] .. pattern .. [[ \)\m$]] )
7
+ local regex = vim .regex ([===[ \%(\%([^[:alnum:][:blank:]]\+\|\w\+\)\)\m$]===] )
9
8
10
9
local function nvim_snippet_exists ()
11
10
local status , _ = pcall (require , " snippets" )
@@ -43,10 +42,12 @@ return h.make_builtin({
43
42
return
44
43
end
45
44
45
+ local prefix = vim .trim (line_to_cursor :sub (start_col ))
46
46
local items = {}
47
47
local snippets = get_loaded_snippets (params .filetype )
48
+
48
49
for _ , item in pairs (snippets ) do
49
- if vim .startswith (item .prefix , line_to_cursor : sub ( start_col ) ) then
50
+ if vim .startswith (item .prefix , prefix ) then
50
51
local insertText = (type (item .body ) == " table" ) and table.concat (item .body , " \n " ) or item .body
51
52
local textEdit = {
52
53
range = {
You can’t perform that action at this time.
0 commit comments