mirror of
https://github.com/Ascyii/vim-gnupg.git
synced 2026-01-01 06:14:24 -05:00
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:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user