Hi Christian,

2012/10/23(Tue) 2:18:07: UTC+9 Christian Brabandt:
> Hi h_east!
> 
> 
> 
> On So, 21 Okt 2012, h_east wrote:
> 
> 
> 
> > 2012/10/22(Mon) 9:28:21 UTC+9 Cesar:
> 
> > > I'm building vim on windows 7.
> 
> > > 
> 
> > > By updating from 692 to 709 I got the following problem:
> 
> > > If I open 'gvim -N -u NONE file' and I type something, say foo, and if I
> 
> > > want to change a character, say f, to n using r in normal mode, it
> 
> > > doesn't work. I always get the same character.
> 
> 
> 
> That was my fault. Sorry for that and issue 88. I am sure I checked, 
> 
> that the else if was within the ca.cmdchar == 'g' check from above, but 
> 
> I must have missed it.
> 
> 
> 
> > I wrote a patch.
> 
> > Please check.
> 
> 
> 
> Not sure, this is the correct solution. I think this patch should fix 
> 
> it:
> 
> 
> 
> diff --git a/src/normal.c b/src/normal.c
> 
> --- a/src/normal.c
> 
> +++ b/src/normal.c
> 
> @@ -1086,7 +1086,8 @@
> 
>                 ca.nchar = ca.extra_char;
> 
>                 idx = find_command(ca.cmdchar);
> 
>             }
> 
> -           else if (ca.nchar == 'n' || ca.nchar == 'N')
> 
> +           else if ((ca.nchar == 'n' || ca.nchar == 'N') && ca.cmdchar == 
> 'g' && cp != NULL)

Thanks for the patch and advice.
Below is my opinion.

`cp != NULL` is guaranteed in Line 989. It may waste.

> 
> +               /* gn or gN from Redo */

When Redo(`.`) processed, the stuff buffer have been set. (I think)
Because vim should check that it is not empty.

Newer patch attached. Please check.

Best regards,
Hirohito Higashi

> 
>                 ca.oap->op_type = get_op_type(*cp, NUL);
> 
>             else if (*cp == Ctrl_BSL)
> 
>             {
> 
> 
> 
> 
> 
> 
> 
> Mit freundlichen Gri??i??en
> 
> Christian
> 
> -- 
> 
> Auch nach der Schulzeit gibt es kein Entrinnen vor den Bibelwerfern.
> 
>               -- Frank Welker

-- 
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 -r 06e088d016ad src/normal.c
--- a/src/normal.c	Sun Oct 21 23:56:05 2012 +0200
+++ b/src/normal.c	Tue Oct 23 10:17:45 2012 +0900
@@ -1086,7 +1086,8 @@
 		ca.nchar = ca.extra_char;
 		idx = find_command(ca.cmdchar);
 	    }
-	    else if (ca.nchar == 'n' || ca.nchar == 'N')
+	    else if (ca.cmdchar == 'g' && (ca.nchar == 'n' || ca.nchar == 'N')
+							    && !stuff_empty())
 		ca.oap->op_type = get_op_type(*cp, NUL);
 	    else if (*cp == Ctrl_BSL)
 	    {

Raspunde prin e-mail lui