mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated vim plugins
This commit is contained in:
@ -339,7 +339,6 @@ function! s:state_proto.update_vars(change)
|
||||
let newWord = strpart(getline('.'), self.start_col - 1, newWordLen)
|
||||
let changeLen = a:change
|
||||
let curLine = line('.')
|
||||
let startCol = col('.')
|
||||
let oldStartSnip = self.start_col
|
||||
let updateTabStops = changeLen != 0
|
||||
let i = 0
|
||||
@ -370,6 +369,12 @@ function! s:state_proto.update_vars(change)
|
||||
" subtract another -1 to exclude the col'th element
|
||||
call setline(lnum, theline[0:(col-2)] . newWord . theline[(col+self.end_col-self.start_col-a:change-1):])
|
||||
endfor
|
||||
|
||||
" Reposition the cursor in case a var updates on the same line but before
|
||||
" the current tabstop
|
||||
if oldStartSnip != self.start_col
|
||||
call cursor(0, col('.') + self.start_col - oldStartSnip)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" should be moved to utils or such?
|
||||
|
Reference in New Issue
Block a user