Skip to content

Commit 7d9036b

Browse files
committed
use TextYankRing autocmd instead of hacking mappings when possible
1 parent 28854ab commit 7d9036b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugin/yankring.vim

+11-2
Original file line numberDiff line numberDiff line change
@@ -2872,8 +2872,17 @@ if has("menu") && g:yankring_default_menu_mode != 0
28722872
endif
28732873

28742874
if g:yankring_enabled == 1
2875-
" Create YankRing Maps
2876-
call s:YRMapsCreate()
2875+
if !exists('##TextYankPost')
2876+
" Create YankRing Maps
2877+
call s:YRMapsCreate()
2878+
else
2879+
augroup YankRing
2880+
au! TextYankPost * call s:YRMRUAdd( 's:yr_history_list'
2881+
\ , getreg(v:event.regname)
2882+
\ , getregtype(v:event.regname)
2883+
\ )
2884+
augroup END
2885+
endif
28772886
endif
28782887

28792888
call s:YRInit()

0 commit comments

Comments
 (0)