diff --git a/doc/yankring.txt b/doc/yankring.txt old mode 100644 new mode 100755 index fcb9c6c..6b70142 --- a/doc/yankring.txt +++ b/doc/yankring.txt @@ -1,7 +1,7 @@ *yankring.txt* For Vim version 7.0. -Author: David Fishburn Jnauary 20, 2013 -Version: 17.0 +Author: David Fishburn September 24, 2013 +Version: 18.0 For instructions on installing this file, type :help add-local-help |add-local-help| inside Vim. @@ -1231,6 +1231,13 @@ mapping: > ============================================================================== 7. History *yankring-history* + 18.0: September 24, 2013 + NF: Handle the @: command (Lingnan Dai). + NF: Added new global option to specify the YankRing buffer name, + g:yankring_buffer_name (Štefan Sakalík). + BF: Did not properly highlight new commands in the YankRing + window (Thilo Six). + 17.0: April 28, 2013 NF: The yankring_history_dir option can now take a comma separated list. First valid directory found will be used (Alex Bel). diff --git a/plugin/yankring.vim b/plugin/yankring.vim old mode 100644 new mode 100755 index b0b8458..7918849 --- a/plugin/yankring.vim +++ b/plugin/yankring.vim @@ -1,9 +1,9 @@ " yankring.vim - Yank / Delete Ring for Vim " --------------------------------------------------------------- -" Version: 17.0 +" Version: 18.0 " Author: David Fishburn " Maintainer: David Fishburn -" Last Modified: 2013 Apr 28 +" Last Modified: 2013 Sep 19 " Script: http://www.vim.org/scripts/script.php?script_id=1234 " Based On: Mocked up version by Yegappan Lakshmanan " http://groups.yahoo.com/group/vim/post?act=reply&messageNum=34406 @@ -19,7 +19,7 @@ if v:version < 700 finish endif -let loaded_yankring = 170 +let loaded_yankring = 180 " Turn on support for line continuations when creating the script let s:cpo_save = &cpo @@ -42,6 +42,10 @@ else endfor endif +if !exists('g:yankring_buffer_name') + let g:yankring_buffer_name = '[YankRing]' +endif + if !exists('g:yankring_history_file') let g:yankring_history_file = 'yankring_history' endif @@ -263,7 +267,6 @@ if !exists('g:yankring_default_menu_mode') endif " Script variables for the yankring buffer -let s:yr_buffer_name = '[YankRing]' let s:yr_buffer_last_winnr = -1 let s:yr_buffer_last = -1 let s:yr_buffer_id = -1 @@ -538,7 +541,7 @@ function! s:YRGetElem(...) if a:0 > 1 " If the user indicated to paste above or below " let direction = ((a:2 ==# 'P') ? 'P' : 'p') - if a:2 =~ '\(p\|gp\|P\|gP\)' + if a:2 =~ '\<\(p\|gp\|P\|gP\)\>' let direction = a:2 endif endif @@ -1651,8 +1654,6 @@ endfunction " Handle macros (@). -" This routine is not used, YRMapsExpression is used to -" handle the @ symbol. function! s:YRMapsMacro(bang, ...) " If we are repeating a series of commands we must " unmap the _zap_ keys so that the user is not @@ -1673,7 +1674,7 @@ function! s:YRMapsMacro(bang, ...) return "" endif - if zapto !~ '\(\w\|@\)' + if zapto !~ '\(\w\|@\|:\)' " Abort if the user does not specify a register call s:YRWarningMsg( "YR:No register specified, aborting macro" ) return "" @@ -2302,7 +2303,7 @@ function! s:YRWindowOpen(results) " Using :e and hide prevents the alternate buffer " from being changed. - exec ":e " . escape(s:yr_buffer_name, ' ') + exec ":e " . escape(g:yankring_buffer_name, ' ') " Save buffer id let s:yr_buffer_id = bufnr('%') + 0 else @@ -2342,13 +2343,15 @@ function! s:YRWindowOpen(results) syn match yankringKey #^AutoClose.*#hs=e-6 syn match yankringKey #^AutoClose.*\[g\]p#hs=e-3 contains=yankringKey - syn match yankringKey #^AutoClose.*\[p\]P#hs=e-3 contains=yankringKey + syn match yankringKey #^AutoClose.*\[g\]P#hs=e-3 contains=yankringKey syn match yankringKey #^AutoClose.*,d,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*,r,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*,s,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*,a,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*,c,#hs=e-1,he=e-1 contains=yankringKey + syn match yankringKey #^AutoClose.*,i,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*,u,#hs=e-1,he=e-1 contains=yankringKey + syn match yankringKey #^AutoClose.*,R,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*,q,#hs=e-1,he=e-1 contains=yankringKey syn match yankringKey #^AutoClose.*#hs=e-6 contains=yankringKey syn match yankringKey #^AutoClose.*?$#hs=e contains=yankringKey @@ -2498,7 +2501,7 @@ function! s:YRWindowAction(op, cmd_mode) range " so set it to at least 1 let v_count = ((v_count > 0)?(v_count):1) - if '[dr]' =~ opcode + if '\<[drP]\>' =~# opcode " Reverse the order of the lines to act on let begin = lastline while begin >= firstline