Skip to content

Commit 39428f6

Browse files
committed
Limit plumbed search pattern to its closing character
With this the search patterns in file locations now support the ctags format. The end is marked by the next unescaped occurance of the first character.
1 parent 4a30334 commit 39428f6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

plugin/acme.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,12 @@ function s:Goto(pos)
493493
exe 'normal!' col.'|'
494494
endif
495495
elseif a:pos =~ '^[/?]'
496+
let [i, n] = [1, len(a:pos)]
497+
while i < n && a:pos[i] != a:pos[0]
498+
let i += 1 + (a:pos[i] == '\')
499+
endwhile
496500
exe 'normal!' (a:pos[0] == '/' ? 'gg' : 'G$')
497-
call search(a:pos[1:], a:pos[0] == '?' ? 'b' : 'c')
501+
call search(a:pos[1:i-1], a:pos[0] == '?' ? 'b' : 'c')
498502
endif
499503
endfunc
500504

0 commit comments

Comments
 (0)