File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ local function get_snippet_at_cursor(auto_trigger)
167
167
end
168
168
169
169
local word = current_line_to_col :match (' (%S*)$' ) -- Remove leading whitespace
170
- local kword = fn .matchstr (word , ' \\ k\\ +$' )
171
170
local word_bound = true
172
171
local scopes = shared .get_scopes ()
173
172
while # word > 0 do
@@ -194,10 +193,6 @@ local function get_snippet_at_cursor(auto_trigger)
194
193
if word == current_line_to_col then
195
194
return word , snippet
196
195
end
197
- elseif snippet .option .word then
198
- if word == kword then
199
- return word , snippet
200
- end
201
196
else
202
197
if word_bound then
203
198
-- By default only match on word boundary
@@ -209,8 +204,8 @@ local function get_snippet_at_cursor(auto_trigger)
209
204
end
210
205
end
211
206
end
212
- word = word : sub ( 2 )
213
- word_bound = false
207
+ word_bound = fn . match ( word , ' ^ \\ k ' ) == - 1
208
+ word = fn . strcharpart ( word , 1 )
214
209
end
215
210
end
216
211
return nil , nil
Original file line number Diff line number Diff line change @@ -835,7 +835,7 @@ describe('Snippy', function()
835
835
feed (' <plug>(snippy-expand)' )
836
836
screen :expect ({
837
837
grid = [[
838
- foo Expand only if space -delimited word present!^ |
838
+ foo Expand if keyword -delimited word present!^ |
839
839
{1:~ }|
840
840
{1:~ }|
841
841
{1:~ }|
@@ -849,7 +849,7 @@ describe('Snippy', function()
849
849
feed (' <plug>(snippy-expand)' )
850
850
screen :expect ({
851
851
grid = [[
852
- @@@default^ |
852
+ @@@Expand if keyword-delimited word present!^ |
853
853
{1:~ }|
854
854
{1:~ }|
855
855
{1:~ }|
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ snippet word "Test word" w
7
7
snippet comment " Test custome expand (comment)" c
8
8
Expand this if on a commented line!
9
9
snippet default " Test default"
10
- Expand only if space -delimited word present!
10
+ Expand if keyword -delimited word present!
You can’t perform that action at this time.
0 commit comments