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()
|
fun s:GPGEncrypt()
|
||||||
" save window view
|
" save window view
|
||||||
let s:GPGWindowView = winsaveview()
|
if v:version >= 700
|
||||||
call s:GPGDebug(2, "saved window view " . string(s:GPGWindowView))
|
let s:GPGWindowView = winsaveview()
|
||||||
|
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
|
||||||
call winrestview(s:GPGWindowView)
|
if v:version >= 700
|
||||||
call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView))
|
call winrestview(s:GPGWindowView)
|
||||||
|
call s:GPGDebug(2, "restored window view" . string(s:GPGWindowView))
|
||||||
|
endi
|
||||||
|
|
||||||
" refresh screen
|
" refresh screen
|
||||||
redraw!
|
redraw!
|
||||||
|
|||||||
Reference in New Issue
Block a user