Skip to content

Commit 839816f

Browse files
dfishburnvim-scripts
authored andcommitted
Version 18.0
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).
1 parent a884f3a commit 839816f

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

doc/yankring.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*yankring.txt* For Vim version 7.0.
22

3-
Author: David Fishburn Jnauary 20, 2013
4-
Version: 17.0
3+
Author: David Fishburn September 24, 2013
4+
Version: 18.0
55

66
For instructions on installing this file, type
77
:help add-local-help |add-local-help| inside Vim.
@@ -1231,6 +1231,13 @@ mapping: >
12311231
==============================================================================
12321232
7. History *yankring-history*
12331233

1234+
18.0: September 24, 2013
1235+
NF: Handle the @: command (Lingnan Dai).
1236+
NF: Added new global option to specify the YankRing buffer name,
1237+
g:yankring_buffer_name (Štefan Sakalík).
1238+
BF: Did not properly highlight new commands in the YankRing
1239+
window (Thilo Six).
1240+
12341241
17.0: April 28, 2013
12351242
NF: The yankring_history_dir option can now take a comma separated
12361243
list. First valid directory found will be used (Alex Bel).

plugin/yankring.vim

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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
2020
endif
2121

22-
let loaded_yankring = 170
22+
let loaded_yankring = 180
2323

2424
" Turn on support for line continuations when creating the script
2525
let s:cpo_save = &cpo
@@ -42,6 +42,10 @@ else
4242
endfor
4343
endif
4444

45+
if !exists('g:yankring_buffer_name')
46+
let g:yankring_buffer_name = '[YankRing]'
47+
endif
48+
4549
if !exists('g:yankring_history_file')
4650
let g:yankring_history_file = 'yankring_history'
4751
endif
@@ -263,7 +267,6 @@ if !exists('g:yankring_default_menu_mode')
263267
endif
264268

265269
" Script variables for the yankring buffer
266-
let s:yr_buffer_name = '[YankRing]'
267270
let s:yr_buffer_last_winnr = -1
268271
let s:yr_buffer_last = -1
269272
let 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.
16561657
function! 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

Comments
 (0)