11" yankring.vim - Yank / Delete Ring for Vim
22" ---------------------------------------------------------------
3- " Version: 17 .0
3+ " Version: 18 .0
44" Author: David Fishburn <dfishburn dot vim at gmail dot com>
55" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
6- " Last Modified: 2013 Apr 28
6+ " Last Modified: 2013 Sep 19
77" Script: http://www.vim.org/scripts/script.php?script_id=1234
88" Based On: Mocked up version by Yegappan Lakshmanan
99" http://groups.yahoo.com/group/vim/post?act=reply&messageNum=34406
@@ -19,7 +19,7 @@ if v:version < 700
1919 finish
2020endif
2121
22- let loaded_yankring = 170
22+ let loaded_yankring = 180
2323
2424" Turn on support for line continuations when creating the script
2525let s: cpo_save = &cpo
4242 endfor
4343endif
4444
45+ if ! exists (' g:yankring_buffer_name' )
46+ let g: yankring_buffer_name = ' [YankRing]'
47+ endif
48+
4549if ! exists (' g:yankring_history_file' )
4650 let g: yankring_history_file = ' yankring_history'
4751endif
@@ -263,7 +267,6 @@ if !exists('g:yankring_default_menu_mode')
263267endif
264268
265269" Script variables for the yankring buffer
266- let s: yr_buffer_name = ' [YankRing]'
267270let s: yr_buffer_last_winnr = -1
268271let s: yr_buffer_last = -1
269272let s: yr_buffer_id = -1
@@ -538,7 +541,7 @@ function! s:YRGetElem(...)
538541 if a: 0 > 1
539542 " If the user indicated to paste above or below
540543 " let direction = ((a:2 ==# 'P') ? 'P' : 'p')
541- if a: 2 = ~ ' \(p\|gp\|P\|gP\)'
544+ if a: 2 = ~ ' \<\ (p\|gp\|P\|gP\)\> '
542545 let direction = a: 2
543546 endif
544547 endif
@@ -1651,8 +1654,6 @@ endfunction
16511654
16521655
16531656" Handle macros (@).
1654- " This routine is not used, YRMapsExpression is used to
1655- " handle the @ symbol.
16561657function ! s: YRMapsMacro (bang , ... )
16571658 " If we are repeating a series of commands we must
16581659 " unmap the _zap_ keys so that the user is not
@@ -1673,7 +1674,7 @@ function! s:YRMapsMacro(bang, ...)
16731674 return " "
16741675 endif
16751676
1676- if zapto !~ ' \(\w\|@\)'
1677+ if zapto !~ ' \(\w\|@\|:\ )'
16771678 " Abort if the user does not specify a register
16781679 call s: YRWarningMsg ( " YR:No register specified, aborting macro" )
16791680 return " "
@@ -2302,7 +2303,7 @@ function! s:YRWindowOpen(results)
23022303
23032304 " Using :e and hide prevents the alternate buffer
23042305 " from being changed.
2305- exec " :e " . escape (s: yr_buffer_name , ' ' )
2306+ exec " :e " . escape (g: yankring_buffer_name , ' ' )
23062307 " Save buffer id
23072308 let s: yr_buffer_id = bufnr (' %' ) + 0
23082309 else
@@ -2342,13 +2343,15 @@ function! s:YRWindowOpen(results)
23422343
23432344 syn match yankringKey # ^AutoClose.*<enter># hs =e - 6
23442345 syn match yankringKey # ^AutoClose.*\[ g\] p# hs =e - 3 contains =yankringKey
2345- syn match yankringKey # ^AutoClose.*\[ p \] P# hs =e - 3 contains =yankringKey
2346+ syn match yankringKey # ^AutoClose.*\[ g \] P# hs =e - 3 contains =yankringKey
23462347 syn match yankringKey # ^AutoClose.*,d,# hs =e - 1 ,he =e - 1 contains =yankringKey
23472348 syn match yankringKey # ^AutoClose.*,r,# hs =e - 1 ,he =e - 1 contains =yankringKey
23482349 syn match yankringKey # ^AutoClose.*,s,# hs =e - 1 ,he =e - 1 contains =yankringKey
23492350 syn match yankringKey # ^AutoClose.*,a,# hs =e - 1 ,he =e - 1 contains =yankringKey
23502351 syn match yankringKey # ^AutoClose.*,c,# hs =e - 1 ,he =e - 1 contains =yankringKey
2352+ syn match yankringKey # ^AutoClose.*,i,# hs =e - 1 ,he =e - 1 contains =yankringKey
23512353 syn match yankringKey # ^AutoClose.*,u,# hs =e - 1 ,he =e - 1 contains =yankringKey
2354+ syn match yankringKey # ^AutoClose.*,R,# hs =e - 1 ,he =e - 1 contains =yankringKey
23522355 syn match yankringKey # ^AutoClose.*,q,# hs =e - 1 ,he =e - 1 contains =yankringKey
23532356 syn match yankringKey # ^AutoClose.*<space># hs =e - 6 contains =yankringKey
23542357 syn match yankringKey # ^AutoClose.*?$# hs =e contains =yankringKey
@@ -2498,7 +2501,7 @@ function! s:YRWindowAction(op, cmd_mode) range
24982501 " so set it to at least 1
24992502 let v_count = ((v_count > 0 )?(v_count):1 )
25002503
2501- if ' [dr] ' = ~ opcode
2504+ if ' \<[drP]\> ' = ~# opcode
25022505 " Reverse the order of the lines to act on
25032506 let begin = lastline
25042507 while begin >= firstline
0 commit comments