From fceb8855f9a83362132dc196642446fa7c55c940 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 23 Jan 2008 09:49:33 +0000 Subject: [PATCH] Save/restore view of saved window instead of cursor position. --- plugin/gnupg.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index fe7205b..5d66d50 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -293,9 +293,9 @@ endf " encrypts the buffer to all previous recipients " fun s:GPGEncrypt() - " save cursor position - let s:GPGCursorPosition = getpos(".") - call s:GPGDebug(2, "saved cursor position " . string(s:GPGCursorPosition)) + " save window view + let s:GPGWindowView = winsaveview() + call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView)) " store encoding and switch to a safe one if &fileencoding != &encoding @@ -412,9 +412,9 @@ fun s:GPGEncryptPost() call s:GPGDebug(2, "restored encoding \"" . &encoding . "\"") endi - " restore cursor position - call setpos('.', s:GPGCursorPosition) - call s:GPGDebug(2, "restored cursor position " . string(s:GPGCursorPosition)) + " restore window view + call winrestview(s:GPGWindowView) + call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView)) " refresh screen redraw!