aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-04 21:48:59 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-04 21:48:59 +1200
commit99fe9596b3b8b4fcd653888132f757a9fb6a5e02 (patch)
tree98f737f2bc82d9976874bd13508757e826a57a72
parent9c539c41dcfdf68e5573fc7c9d64e5d2d1db5e5a (diff)
downloaddotfiles-99fe9596b3b8b4fcd653888132f757a9fb6a5e02.tar.gz
Support counts and registers in paste wrapping
-rw-r--r--vim/after/ftplugin/markdown/autoformat.vim6
1 files changed, 3 insertions, 3 deletions
diff --git a/vim/after/ftplugin/markdown/autoformat.vim b/vim/after/ftplugin/markdown/autoformat.vim
index 78a2c23a..3f620691 100644
--- a/vim/after/ftplugin/markdown/autoformat.vim
+++ b/vim/after/ftplugin/markdown/autoformat.vim
@@ -65,14 +65,14 @@ augroup END
if !has('*s:Put')
function! s:Put(above) abort
let l:suspended = 0
- if &formatoptions =~# '\ma' && @" =~# '\m\n'
+ if &formatoptions =~# '\ma' && getreg() =~# '\m\n'
setlocal formatoptions-=a
let l:suspended = 1
endif
if a:above
- normal! P
+ execute 'normal! "'.v:register.v:count1.'P'
else
- normal! p
+ execute 'normal! "'.v:register.v:count1.'p'
endif
if l:suspended
setlocal formatoptions+=a