To: "Andreas Rohrschneider" <
[email protected]>
In-Reply-To: <
[email protected]>
Cc:
[email protected]
Subject: patch 5.5a.15 (was: Bug with i_CTRL-A?)
Fcc: outbox
From: Bram Moolenaar <
[email protected]>
------------
Andreas Rohrschneider wrote:
> a colleague of mine found some really strange behavior concerning i_CTRL-A.
> It seems that CTRL-A in insert mode behaves differently when you enter into
> insert mode via the <insert> key instead of using 'i'. Example:
>
> Consider a buffer with the following lines:
>
> aaaa
> bbbb
>
> Now place the cursor onto the last character in the first line and enter the
> following key sequence: <Insert><Right> cccc<Down><CTRL-A>
> Then the buffer looks as follows:
>
> aaaa cccc
> bbbbccc
>
> The alternate key sequence i<Right> cccc<Down><CTRL-A> produces a different
> result:
>
> aaaa cccc
> bbbb cccc
Right, this is a bug. It appears on all systems. I'll fix it:
Patch 5.5a.15
Problem: Using CTRL-A in Insert mode doesn't work correctly when the insert
started with the <Insert> key. (Andreas Rohrschneider)
Solution: Replace <Insert> with "i" before setting up the redo buffer.
Files: src/normal.c
*** ../vim-5.5a.14/src/normal.c Thu Sep 9 17:28:24 1999
--- src/normal.c Fri Sep 10 11:27:40 1999
***************
*** 5678,5683 ****
--- 5678,5687 ----
nv_edit(cap)
CMDARG *cap;
{
+ /* <Insert> is equal to "i" */
+ if (cap->cmdchar == K_INS)
+ cap->cmdchar = 'i';
+
/* in Visual mode "A" and "I" are an operator */
if ((cap->cmdchar == 'A' || cap->cmdchar == 'I')
&& VIsual_active)
*** ../vim-5.5a.14/src/version.c Thu Sep 9 23:01:50 1999
--- src/version.c Fri Sep 10 11:32:48 1999
***************
*** 420,420 ****
--- 420,421 ----
{ /* Add new patch number below this line */
+ 15,
--
CART DRIVER: Bring out your dead!
LARGE MAN: Here's one!
CART DRIVER: Ninepence.
BODY: I'm not dead!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
--/-/---- Bram Moolenaar ----
[email protected] ----
[email protected] ---\-\--
\ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /