mirror of
https://github.com/gryf/snipmate.vim.git
synced 2025-12-21 21:37:59 +01:00
fixed bug with variables at end of lines
This commit is contained in:
@@ -141,14 +141,14 @@ fun s:BuildTabStops(snip, lnum, col, indent)
|
|||||||
let dots = repeat('.', snipPos[j][2])
|
let dots = repeat('.', snipPos[j][2])
|
||||||
call add(snipPos[j], [])
|
call add(snipPos[j], [])
|
||||||
let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g')
|
let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g')
|
||||||
while match(withoutOthers, '$'.i.'\D') != -1
|
while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1
|
||||||
let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\D')
|
let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)')
|
||||||
call add(snipPos[j][3], [0, 0])
|
call add(snipPos[j][3], [0, 0])
|
||||||
let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n")
|
let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n")
|
||||||
let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum
|
let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum
|
||||||
\ ? len(matchstr(beforeMark, '.*\n\zs.*'))
|
\ ? len(matchstr(beforeMark, '.*\n\zs.*'))
|
||||||
\ : a:col + len(beforeMark))
|
\ : a:col + len(beforeMark))
|
||||||
let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\D', '', '')
|
let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '')
|
||||||
endw
|
endw
|
||||||
endif
|
endif
|
||||||
let i += 1
|
let i += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user