Vim version compatibility

Wrap winsaveview() and winrestview() with v:version > 700 to make the plugin run under older vim versions.
This commit is contained in:
Markus Braun
2008-02-13 06:00:19 +00:00
parent 9f4f083367
commit 9cb02c800a

View File

@@ -303,8 +303,10 @@ endf
" "
fun s:GPGEncrypt() fun s:GPGEncrypt()
" save window view " save window view
if v:version >= 700
let s:GPGWindowView = winsaveview() let s:GPGWindowView = winsaveview()
call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView)) call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView))
endi
" store encoding and switch to a safe one " store encoding and switch to a safe one
if &fileencoding != &encoding if &fileencoding != &encoding
@@ -422,8 +424,10 @@ fun s:GPGEncryptPost()
endi endi
" restore window view " restore window view
if v:version >= 700
call winrestview(s:GPGWindowView) call winrestview(s:GPGWindowView)
call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView)) call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView))
endi
" refresh screen " refresh screen
redraw! redraw!