Strange behavior using caret or backtick

49 views
Skip to first unread message

Axel Bender

unread,
Oct 22, 2012, 11:27:49 AM10/22/12
to vim...@googlegroups.com
Since some patches I experience the following behavior ([] denotes the cursor position, current patch level: 7.2.709):

a[a]aa -> a
aa[]aa -> <spc>
aa []aa -> ^
aa []aa -> <spc> " Should result in "aa ^[]aa"
aa []aa -> <esc>
aa[ ]aa -> s " gA shows 0x20
[]$a aa " Should result in "aa[]$aa"

This seems to be a bug. Can anyone verify this (Windows 7 64-bit; MinGW64-compiled)?

Axel Bender

unread,
Oct 22, 2012, 11:34:04 AM10/22/12
to vim...@googlegroups.com
Erratum: The current patch level here is 7.3.709 (not 7.2.709).

Ben Fritz

unread,
Oct 22, 2012, 12:51:45 PM10/22/12
to vim...@googlegroups.com
On Monday, October 22, 2012 10:27:49 AM UTC-5, Axel Bender wrote:
> Since some patches I experience the following behavior ([] denotes the cursor position, current patch level: 7.3.709):
>
> a[a]aa -> a
> aa[]aa -> <spc>
> aa []aa -> ^
> aa []aa -> <spc> " Should result in "aa ^[]aa"
> aa []aa -> <esc>
> aa[ ]aa -> s " gA shows 0x20
> []$a aa " Should result in "aa[]$aa"
>
> This seems to be a bug. Can anyone verify this (Windows 7 64-bit; MinGW64-compiled)?

I cannot reproduce on Windows XP 64-bit with the "Vim without Cream" build of 7.3.709. I'm not 100% clear I understood your procedure however. Here is what I did:

1. gvim -N -u NONE -i NONE
2. Press a, enter text "aaaa", press <Esc> key.
3. Press 0 and then l to place the cursor on the second 'a' character.
4. Press a to enter insert mode
5. Press <Space> key to insert a space character
6. Press Shift+6 to enter a literal '^' character.
7. Press <Space> key again
8. Press <Esc> to leave insert mode
9. Verify text as expected: "aa ^ aa" with cursor on the second space character.
10. Press 's' to delete the space and go into insert mode
11. Press $ to insert a '$' character.
12. Verify text as expected: "aa ^$aa" with cursor between the $ and a character.

Tony Mechelynck

unread,
Oct 22, 2012, 10:21:59 PM10/22/12
to vim...@googlegroups.com
Which key(s) to press to get a ^ (spacing circumflex) depends on your
keyboard layout.

On most French-language AZERTY keyboards, the key on the right of the P
(as in AZERTYUIOP), when unshifted, is a dead-circumflex (and when
shifted, a dead diaeresis/umlaut), so <dead-^><space> produces a spacing ^

This is also true on my Belgian keyboard (some of whose non-numeric
non-alphabetic keys are other than in France) and in addition,
<Alt-Gr+NoShift+6> (6 is shifted on this keyboard) also produces a
spacing ^ (for details, see
http://users.skynet.be/antoine.mechelynck/other/keybbe.htm )

If Axel's keyboard is of this kind, by "^" he may be meaning "dead-^"
which, by itself, is not seen by Vim: Vim only sees it if it is followed
by some letter which has a precombined variant with circumflex: this
means space or dead-^ (either of which produces a spacing ^), any vowel,
or, at least in a UTF-8 locale, the consonants c g h j s (upper- or
lowercase) because ĉ ĝ ĥ ĵ ŝ (and ŭ) exist in Esperanto. If followed by
something else, some keyboard drivers (as the one I had on MS-DOS) will
change the dead-^ to a spacing-^ (so that "dead ^" followed by p becomes
^p), others (as the one I now have on Linux) will disregard both
keystrokes and pass nothing to the keyboard input buffer…

And no, I can't reproduce what Axel shows, neither by assuming that his
^ is a dead ^ nor that it is a spacing ^. Obviously the dollar sign
keypress somehow never was reflected in his email. If I hit dollar after
the s keypress, and assuming a dead circumflex, I get, as expected, aa
^|aa after hitting dead-^ followed by space, and aa $|aa if I hit
<esc>s$ thereafter, where | represents the left (black) side of the
insert-mode cursor.


Best regards,
Tony.
--
"Here's the holiday schedule for Monday's observation of Martin Luther
King Jr.'s birthday, when the following will be closed:

* Governmental offices
* Post offices
* Libraries
* Schools
* Banks
* Parts of Palm Beach

and the mind of Senator Jesse Helms of North Carolina."
-- Dennis Miller, "Saturday Night Live"

Axel Bender

unread,
Oct 29, 2012, 11:58:34 AM10/29/12
to vim...@googlegroups.com
Sorry for opening another thread. After having been away for a week, I was not aware of having posted this before (also had not found it in a "quick" search). I think, the thread should continue here.

@Tony

yes, I'm using the German keyboard using "^" as a combining key. The exact order of input is a given below ("..." denotes input, initially the cursor is on the second "a" in normal mode):

gvim -N -u NONE -i NONE -U NONE

a[a]aa -> "a"

aa[]aa -> "<spc>^<spc>"
aa []aa -> "<esc>"
aa[ ]aa -> (ga shows 0x20), "s"
[]a aa -> (first a elimiated; an "$" is only shown with .vimrc), "123"
123[]a aa -> "<esc>"
12[3]a aa

GVim behaves correctly in version 7.3.046 as downloadable from the homepage:

a[a]aa -> "a"

aa[]aa -> "<spc>^<spc>"
aa ^[]aa -> "<esc>"
aa [^]aa -> (ga shows 0x5E), "s"
aa []aa -> "123"
aa 123[]aa -> "<esc>"
aa 12[3]aa

Can provide binary and/or video.

Ben Fritz

unread,
Oct 29, 2012, 2:08:12 PM10/29/12
to vim...@googlegroups.com
On Monday, October 29, 2012 10:58:34 AM UTC-5, Axel Bender wrote:
> I'm using the German keyboard using "^" as a combining key. The exact order of input is a given below ("..." denotes input, initially the cursor is on the second "a" in normal mode):
>
> gvim -N -u NONE -i NONE -U NONE
>
> a[a]aa -> "a"
> aa[]aa -> "<spc>^<spc>"
> aa []aa -> "<esc>"
> aa[ ]aa -> (ga shows 0x20), "s"
> []a aa -> (first a elimiated; an "$" is only shown with .vimrc), "123"
> 123[]a aa -> "<esc>"
> 12[3]a aa
>
> GVim behaves correctly in version 7.3.046 as downloadable from the homepage:
>
> a[a]aa -> "a"
> aa[]aa -> "<spc>^<spc>"
> aa ^[]aa -> "<esc>"
> aa [^]aa -> (ga shows 0x5E), "s"
> aa []aa -> "123"
> aa 123[]aa -> "<esc>"
> aa 12[3]aa
>
> Can provide binary and/or video.

OK, I think I understand now. Is the following correct?

You pressed a key which does nothing by itself, but rather combines with the next key to yield either an accented letter, or a literal '^' character depending on which key follows. You then pressed the "space" key, expecting Vim to enter a single '^' character. Instead, Vim inserted nothing at all.

Furthermore, when you typed 's' after this operation, with the cursor on a character in the middle of the line, you expected Vim to delete that character and enter insert mode. Vim instead jumped to the beginning of the line and deleted the character there, entering insert mode at that point.

If this is correct, I do not have a keyboard that can provide Vim the required input, nor am I familiar with a mapping that will provide this capability, so I'm afraid I cannot be of much further use besides:

Have you checked that a plugin or .vimrc setting is not causing this, by launching Vim from a command-line with "gvim -N -u NONE -U NONE -i NONE"?

Axel Bender

unread,
Oct 30, 2012, 10:20:15 AM10/30/12
to vim...@googlegroups.com
@Ben

Yes, that's the exact bahavior, and yes I used the switches you specified. Also, the described behavior is not appearing in 7.3.046.

Reply all
Reply to author
Forward
0 new messages