mirror of
https://github.com/Ascyii/vim-gnupg.git
synced 2026-01-01 14:24:25 -05:00
Save/restore view of saved window instead of cursor position.
This commit is contained in:
@@ -293,9 +293,9 @@ endf
|
|||||||
" encrypts the buffer to all previous recipients
|
" encrypts the buffer to all previous recipients
|
||||||
"
|
"
|
||||||
fun s:GPGEncrypt()
|
fun s:GPGEncrypt()
|
||||||
" save cursor position
|
" save window view
|
||||||
let s:GPGCursorPosition = getpos(".")
|
let s:GPGWindowView = winsaveview()
|
||||||
call s:GPGDebug(2, "saved cursor position " . string(s:GPGCursorPosition))
|
call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView))
|
||||||
|
|
||||||
" store encoding and switch to a safe one
|
" store encoding and switch to a safe one
|
||||||
if &fileencoding != &encoding
|
if &fileencoding != &encoding
|
||||||
@@ -412,9 +412,9 @@ fun s:GPGEncryptPost()
|
|||||||
call s:GPGDebug(2, "restored encoding \"" . &encoding . "\"")
|
call s:GPGDebug(2, "restored encoding \"" . &encoding . "\"")
|
||||||
endi
|
endi
|
||||||
|
|
||||||
" restore cursor position
|
" restore window view
|
||||||
call setpos('.', s:GPGCursorPosition)
|
call winrestview(s:GPGWindowView)
|
||||||
call s:GPGDebug(2, "restored cursor position " . string(s:GPGCursorPosition))
|
call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView))
|
||||||
|
|
||||||
" refresh screen
|
" refresh screen
|
||||||
redraw!
|
redraw!
|
||||||
|
|||||||
Reference in New Issue
Block a user