mirror of
https://github.com/gryf/snipmate.vim.git
synced 2026-01-31 04:55:46 +01:00
fixed bug with updating tab stops when new lines are inserted
This commit is contained in:
@@ -24,7 +24,7 @@ fun snipMate#expandSnip(snip, col)
|
|||||||
else
|
else
|
||||||
let afterCursor = ''
|
let afterCursor = ''
|
||||||
" For some reason the cursor needs to move one right after this
|
" For some reason the cursor needs to move one right after this
|
||||||
if line != '' && col == 1 && &ve !~ 'all\|onemore'
|
if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore'
|
||||||
let col += 1
|
let col += 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -230,6 +230,7 @@ fun s:UpdateTabStops()
|
|||||||
" Update the line number of all proceeding tab stops if <cr> has
|
" Update the line number of all proceeding tab stops if <cr> has
|
||||||
" been inserted.
|
" been inserted.
|
||||||
if changeLine != 0
|
if changeLine != 0
|
||||||
|
let changeLine -= 1
|
||||||
for pos in g:snipPos[s:curPos + 1:]
|
for pos in g:snipPos[s:curPos + 1:]
|
||||||
if pos[0] >= lnum
|
if pos[0] >= lnum
|
||||||
if pos[0] == lnum | let pos[1] += changeCol | endif
|
if pos[0] == lnum | let pos[1] += changeCol | endif
|
||||||
@@ -388,3 +389,4 @@ fun s:UpdateVars()
|
|||||||
let s:oldWord = newWord
|
let s:oldWord = newWord
|
||||||
let g:snipPos[s:curPos][2] = newWordLen
|
let g:snipPos[s:curPos][2] = newWordLen
|
||||||
endf
|
endf
|
||||||
|
" vim:noet:sw=4:ts=4:ft=vim
|
||||||
|
|||||||
Reference in New Issue
Block a user