Commits

Audrius Kažukauskas committed fbd7be7

Upgrade to visualrepeat.vim 1.03.

Comments (0)

Files changed (2)

autoload/visualrepeat.vim

 "
 " DEPENDENCIES:
 "
-" Copyright: (C) 2011-2012 Ingo Karkat
+" Copyright: (C) 2011-2013 Ingo Karkat
 "   The VIM LICENSE applies to this script; see ':help copyright'.
 "
 " Maintainer:	Ingo Karkat <ingo@karkat.de>
 "
 " REVISION	DATE		REMARKS
+"   1.03.009	21-Feb-2013	REGRESSION: Fix in 1.02 does not repeat recorded
+"				register when the mappings in repeat.vim and
+"				visualrepeat.vim differ. We actually need to
+"				always check g:repeat_sequence, since that is
+"				also installed in g:repeat_reg[0]. Caught by
+"				tests/ReplaceWithRegister/repeatLineAsVisual001.vim;
+"				if only I had executed the tests sooner :-(
+"				Fix by checking for the variable's existence
+"				instead of using l:repeat_sequence.
 "   1.02.008	27-Dec-2012	BUG: "E121: Undefined variable:
 "				g:repeat_sequence" when using visual repeat
 "				of a mapping using registers without having used
 "				it, and avoids setting the 'modified' flag on
 "				unmodified buffers, which is not expected.
 "	001	17-Mar-2011	file creation
+let s:save_cpo = &cpo
+set cpo&vim
 
 let g:visualrepeat_tick = -1
 
 	    " Handle mappings that use a register and want the same register
 	    " used on repetition.
 	    let l:reg = ''
-	    if exists('g:repeat_reg') && g:repeat_reg[0] ==# l:repeat_sequence && ! empty(g:repeat_reg[1])
+	    if exists('g:repeat_reg') && exists('g:repeat_sequence') &&
+	    \   g:repeat_reg[0] ==# g:repeat_sequence && ! empty(g:repeat_reg[1])
 		if g:repeat_reg[1] ==# '='
 		    " This causes a re-evaluation of the expression on repeat, which
 		    " is what we want.
     autocmd BufEnter,BufWritePost * if g:visualrepeat_tick == 0|let g:visualrepeat_tick = b:changedtick|endif
 augroup END
 
+let &cpo = s:save_cpo
+unlet s:save_cpo
 " vim: set ts=8 sts=4 sw=4 noexpandtab ff=unix fdm=syntax :

doc/visualrepeat.txt

 ==============================================================================
 HISTORY							*visualrepeat-history*
 
+1.03	21-Feb-2013
+REGRESSION: Fix in 1.02 does not repeat recorded register when the mappings in
+repeat.vim and visualrepeat.vim differ.
+
 1.02	27-Dec-2012
 BUG: "E121: Undefined variable: g:repeat_sequence" when using visual repeat of
 a mapping using registers without having used repeat.vim beforehand.
 Started development.
 
 ==============================================================================
-Copyright: (C) 2008-2012 Ingo Karkat
+Copyright: (C) 2008-2013 Ingo Karkat
 The VIM LICENSE applies to this script; see |copyright|.
 
 Maintainer:	Ingo Karkat <ingo@karkat.de>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.