aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-06-05 00:03:58 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-06-05 00:03:58 +1200
commitcde6234d4fb5e0cac21f80c83eca6f140b1cdd36 (patch)
treec9e45f4cee3667e55c84f70f6eebd85f34f02a1a
parent0365dd11c050f885050cd6dd22405c81aba5f462 (diff)
downloadvim-paste-insert-cde6234d4fb5e0cac21f80c83eca6f140b1cdd36.tar.gz
vim-paste-insert-cde6234d4fb5e0cac21f80c83eca6f140b1cdd36.zip
Prevent errors when mapping is pressed twice
-rw-r--r--autoload/paste_insert.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/autoload/paste_insert.vim b/autoload/paste_insert.vim
index 49f630f..dc87c98 100644
--- a/autoload/paste_insert.vim
+++ b/autoload/paste_insert.vim
@@ -1,6 +1,11 @@
" Autoloaded entry point function
function! paste_insert#() abort
+ " Stop and do nothing if already in the middle of a paste
+ if exists('#paste_insert#User#Start')
+ return
+ endif
+
" Set up an event table
augroup paste_insert
autocmd!