Andy, Ben,

On Mi, 03 Okt 2012, Christian Brabandt wrote:
> On Di, 02 Okt 2012, Ben Fritz wrote:
> 
> > gvim -N -u NONE -i NONE
> > 
> > Set up some sample text:
> > 
> > 10aone two three<CR><Esc>
> > 
> > Press gg to get the cursor at the top of the buffer.
> > 
> > Perform a search:
> > 
> > /two<CR>
> > 
> > Change text:
> > 
> > cgnduo<Esc>
> > 
> > Do it again, 3 times:
> > 
> > ...
> > 
> > Expected result:
> > 
> > one duo three
> > one duo three
> > one duo three
> > one duo three
> > one two three
> > one two three
> > one two three
> > one two three
> > one two three
> > one two three
> > 
> > Actual result:
> > 
> > one duo three
> > one dududuoee
> > one two three
> > one two three
> > one two three
> > one two three
> > one two three
> > one two three
> > one two three
> > one two three
> > 
> > Vim version:
> 
> Yes, that is a known problem (see 
> https://groups.google.com/group/vim_dev/msg/b3532b18a40b0bcb), but I am 
> not sure, how to get around this.

Could you please test, if the attached patch works for you?

I don't fully understand the redo stuff buffer. So I am not sure, if 
this is the correct way to test, whether the input comes from the stuff 
buffer, but for my simple test case, this seems to work ok.

regards,
Christian
-- 

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -960,8 +960,9 @@
 #ifdef FEAT_CMDL_INFO
 	    need_flushbuf |= add_to_showcmd(ca.nchar);
 #endif
-	    if (ca.nchar == 'r' || ca.nchar == '\'' || ca.nchar == '`'
-						      || ca.nchar == Ctrl_BSL)
+	    if (ca.nchar == 'r' || ca.nchar == '\'' || ca.nchar == '`' || ca.nchar == Ctrl_BSL
+		/* gn from redo, need to get one char to determine the operator */
+		|| (( ca.nchar == 'n' || ca.nchar == 'N') && !stuff_empty()))
 	    {
 		cp = &ca.extra_char;	/* need to get a third character */
 		if (ca.nchar != 'r')
@@ -1083,6 +1084,8 @@
 		ca.nchar = ca.extra_char;
 		idx = find_command(ca.cmdchar);
 	    }
+	    else if (ca.nchar == 'n' || ca.nchar == 'N')
+		ca.oap->op_type = get_op_type(*cp, NUL);
 	    else if (*cp == Ctrl_BSL)
 	    {
 		long towait = (p_ttm >= 0 ? p_ttm : p_tm);

Raspunde prin e-mail lui