Avoid screen jumps when scrolled to second region
This commit is contained in:
parent
f8f96d83ce
commit
e12149d5d6
@ -16,6 +16,8 @@ function! s:exchange(x, y, reverse, expand)
|
||||
let yindent = matchstr(getline(nextnonblank(a:x.start.line)), '^\s*')
|
||||
endif
|
||||
|
||||
let view = winsaveview()
|
||||
|
||||
call s:setpos("'[", a:y.start)
|
||||
call s:setpos("']", a:y.end)
|
||||
call setreg('z', a:x.text, a:x.type)
|
||||
@ -37,6 +39,8 @@ function! s:exchange(x, y, reverse, expand)
|
||||
call s:reindent(a:y.start.line - xlines + ylines, xlines, xindent)
|
||||
endif
|
||||
|
||||
call winrestview(view)
|
||||
|
||||
if a:reverse
|
||||
call cursor(a:x.start.line, a:x.start.column)
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user