Problem by updating from 692 to 709

95 views
Skip to first unread message

Cesar Romani

unread,
Oct 21, 2012, 8:27:50 PM10/21/12
to vim...@vim.org
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.

Many thanks in advance,

--
Cesar

Tony Mechelynck

unread,
Oct 21, 2012, 10:06:51 PM10/21/12
to vim...@googlegroups.com, Cesar Romani, Bram Moolenaar
According to his User-Agent string, Cesar is on Windows (and probably
32-bit). I see the same problem on 64-bit Linux in gvim 7.3.709 with
GTK2-GNOME GUI.

The problem is also present with any of
gvim -u /usr/local/share/vim/vim73/vimrc_example.vim
(started with the example vimrc instead of mine or of none)
gvim
(started normally with my usual vimrc)
vim
(the same executable, in console mode with my usual vimrc)

but the bug depends on *what* I try to replace by. Replacing by N (0x4E)
or n (0x6E) doesn't work. Everything else I tried works, including .
(dot, 0x2E) or î (i-circumflex, 0xEE).

The sound beep doesn't work really well on this computer, but my usual
vimrc sets 'visualbell' and trying to use r to replace something by n or
N triggers the visual bell when in GUI mode.

If a keymap is in use ('iminsert' set to 1) and the current keymap
replaces n by something else (cyrillic "en", н, in my experiment), then
rn replaces by н as expected. But toggle 'imi' to zero (disabling the
keymap) and rn (in the same buffer) again gives a visual beep and
doesn't replace. If the keymap does not remap the letter n (for instance
the "accents" keymap) then rn doesn't work even with 'imi' set to 1. And
if I define ":lmap z n" then, with keymaps enabled, rz gives a visual
beep and does not replace by the expected n.


Best regards,
Tony.
--
Finding out what goes on in the C.I.A. is like performing acupuncture
on a rock.
-- New York Times, Jan. 20, 1981

h_east

unread,
Oct 21, 2012, 10:39:42 PM10/21/12
to vim...@googlegroups.com, vim...@vim.org
Hi, Bram and Cesar

2012/10/22(Mon) 9:28:21 UTC+9 Cesar:

I wrote a patch.
Please check.

Best Regards,
--
Hirohito Higashi

r_not_replace_n.patch

h_east

unread,
Oct 22, 2012, 3:13:55 AM10/22/12
to vim...@googlegroups.com, vim...@vim.org
PS
This patch should attached after 7.3.704.

Joachim Schmitz

unread,
Oct 22, 2012, 3:48:54 AM10/22/12
to vim...@vim.org
Works for me

bye, Jojo

Ben Fritz

unread,
Oct 22, 2012, 1:09:19 PM10/22/12
to vim...@googlegroups.com, vim...@vim.org
I'm not sure whether this patch is the correct solution (it looks like it's patching the correct code), but nevertheless it might also relate to the issue discussed here:

https://groups.google.com/d/topic/vim_dev/Jq7MqquyXX8/discussion

Christian Brabandt

unread,
Oct 22, 2012, 1:18:03 PM10/22/12
to vim...@googlegroups.com, vim...@vim.org
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)
+ /* gn or gN from Redo */
ca.oap->op_type = get_op_type(*cp, NUL);
else if (*cp == Ctrl_BSL)
{



Mit freundlichen Gr��en
Christian
--
Auch nach der Schulzeit gibt es kein Entrinnen vor den Bibelwerfern.
-- Frank Welker

John Little

unread,
Oct 22, 2012, 9:03:50 PM10/22/12
to vim...@googlegroups.com, vim...@vim.org, cbl...@256bit.org
Works for me.

h_east

unread,
Oct 22, 2012, 9:21:24 PM10/22/12
to vim...@googlegroups.com, vim...@vim.org, cbl...@256bit.org
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

against_patch_7_3_704.patch

Bram Moolenaar

unread,
Oct 22, 2012, 11:09:12 PM10/22/12
to Christian Brabandt, vim...@googlegroups.com, vim...@vim.org

Christian Brabandt wrote:

> 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:

That looks OK, except that the check for "cp" not being null isn't
needed. It's used in the next condition.

Would be nice to have a test for "fn;" working.

--
Sometimes you can protect millions of dollars in your budget simply by buying
a bag of cookies, dropping it on the budget anylyst's desk, and saying
something deeply personal such as "How was your weekend, big guy?"
(Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages