Hi h_east!

On Do, 06 Aug 2015, h_east wrote:

> Hi Christian Brabandt and Bram,
> 
> How to reproduce:
> 1. Start pure vim
>     $ vim -N -u NONE
> 
> 2. Change 'nrformats' option to add 'alpha'
>     :set nrformats+=alpha
> 
> 3. Buffer changed to 'a ' and move cursor on 'a'.
>     ia <Esc>0
> 
> 4. Increment on 'a'
>     <C-A>
> 
> Expected behavior:
> - 'a' increment to 'b' and cursor position stay on 'b'.
> 
> Actual behavior:
> - 'a' increment to 'b'. but cursor move to right.
> 
> 
> I attached patch.
> Please check this.

Thanks.

> 
> Chiris.B>
> I was wondering if you could add a test code for this regression.

Here is your patch with a test included.

Mit freundlichen Grüßen
Christian
-- 
Tottis Frau Ilary fragt: "Oh Liebling, liebst du mich, liebst du mich,
liebst du mich denn wirklich?"
Totti: "Gemach, eine Frage nach der anderen."

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/ops.c b/src/ops.c
--- a/src/ops.c
+++ b/src/ops.c
@@ -5584,6 +5584,7 @@ do_addsub(command, Prenum1, g_cmd)
 	    did_change = TRUE;
 	    (void)del_char(FALSE);
 	    ins_char(firstdigit);
+	    curwin->w_cursor.col = col;
 	}
 	else
 	{
diff --git a/src/testdir/test_increment.in b/src/testdir/test_increment.in
--- a/src/testdir/test_increment.in
+++ b/src/testdir/test_increment.in
@@ -268,7 +268,15 @@ Text:
  Expected:
  1) <Ctrl-V>j$ <ctrl-a>
  2
- 1b
+ 2a
+
+20) increment a single letter
+Text:
+ a
+
+ Expected:
+ 1) <Ctrl-a> and cursor is on a
+ b
    
 
 
@@ -386,6 +394,13 @@ V3kg..
 k$
 :set nrformats&vim
 
+:" Test 20
+:set nrformats+=alpha
+:/^S20=/+,/^E20=/-y a
+:/^E20=/+put a
+:.put =col('.')
+:set nrformats&vim
+
 :" Save the report
 :/^# Test 1/,$w! test.out
 :qa!
@@ -572,6 +587,13 @@ E19====
 
 
 
+# Test 20
+S20====
+a
+E20====
+
+
+
 
 ENDTEST
 
diff --git a/src/testdir/test_increment.ok b/src/testdir/test_increment.ok
--- a/src/testdir/test_increment.ok
+++ b/src/testdir/test_increment.ok
@@ -271,6 +271,15 @@ 2
 2a
 
 
+# Test 20
+S20====
+a
+E20====
+
+b
+1
+
+
 
 ENDTEST
 

Raspunde prin e-mail lui