aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-02 14:29:07 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-02 14:29:07 +1200
commit106f3f37f74152449d9083616aee2c43c430e071 (patch)
tree04098aeafd33b9d90942837194c577cfab3aa165
parentFirst commit (diff)
downloadvim-insert-cancel-106f3f37f74152449d9083616aee2c43c430e071.tar.gz
vim-insert-cancel-106f3f37f74152449d9083616aee2c43c430e071.zip
Initialise variable to soothe vint
-rw-r--r--plugin/insert_cancel.vim5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugin/insert_cancel.vim b/plugin/insert_cancel.vim
index c5af7e2..636a54e 100644
--- a/plugin/insert_cancel.vim
+++ b/plugin/insert_cancel.vim
@@ -14,6 +14,9 @@ if v:version < 600
endif
let g:loaded_insert_cancel = 1
+" Initialise s:changenr so vint understands
+let s:changenr = 0
+
" InsertEnter is only available from Vim 7
if has('autocmd') && v:version > 700
augroup insert_cancel
@@ -25,7 +28,7 @@ endif
" Try to figure out whether we made a change to undo, undo it if so
function! s:InsertCancel()
- if &modified && (!exists('s:changenr') || changenr() > s:changenr)
+ if &modified && (!exists('*changenr') || changenr() > s:changenr)
silent undo
endif
endfunction