diff options
Diffstat (limited to 'autoload/insert_cancel.vim')
-rw-r--r-- | autoload/insert_cancel.vim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/autoload/insert_cancel.vim b/autoload/insert_cancel.vim index 41e6c60..afc8c8b 100644 --- a/autoload/insert_cancel.vim +++ b/autoload/insert_cancel.vim @@ -1,3 +1,10 @@ +" On entering insert mode, reset the changed flag and check for a new round of +" changes since insert mode was opened +function! insert_cancel#Enter() + let b:insert_cancel_changed = 0 + call insert_cancel#Check() +endfunction + " On leaving insert mode, whether normally or via <Plug>(InsertCancel), check " if changenr() exceeds the last time we cached it, and flag that a change has " taken place if it did @@ -7,13 +14,6 @@ function! insert_cancel#Check() endif endfunction -" On entering insert mode, reset the changed flag and check for a new round of -" changes since insert mode was opened -function! insert_cancel#Enter() - let b:insert_cancel_changed = 0 - call insert_cancel#Check() -endfunction - " On cancelling insert mode, if we think we made a change, undo it function! insert_cancel#Cancel() if get(b:, 'insert_cancel_changed', 0) |