From 9cb02c800a3477d71f8d95b7b02fb0e19596f227 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 13 Feb 2008 06:00:19 +0000 Subject: [PATCH] Vim version compatibility Wrap winsaveview() and winrestview() with v:version > 700 to make the plugin run under older vim versions. --- plugin/gnupg.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index f83ee1c..43a77b5 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -303,8 +303,10 @@ endf " fun s:GPGEncrypt() " save window view - let s:GPGWindowView = winsaveview() - call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView)) + if v:version >= 700 + let s:GPGWindowView = winsaveview() + call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView)) + endi " store encoding and switch to a safe one if &fileencoding != &encoding @@ -422,8 +424,10 @@ fun s:GPGEncryptPost() endi " restore window view - call winrestview(s:GPGWindowView) - call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView)) + if v:version >= 700 + call winrestview(s:GPGWindowView) + call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView)) + endi " refresh screen redraw!