summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2015-08-11 19:36:42 +0200
committerBram Moolenaar <bram@vim.org>2015-08-11 19:36:42 +0200
commit7411c940c85b1fd9c7d99d6c3cacf3a343c687d1 (patch)
treeaa2657b96526cc1426ebd6c5e358c036a3656f05
parentb1eb5be25384d39e5f1926546a4bd145d7385f95 (diff)
downloadvim-7-4-823.tar.gz
patch 7.4.823v7.4.823v7-4-823
Problem: Cursor moves after CTRL-A on alphabetic character. Solution: (Hirohito Higashi, test by Christian Brabandt)
-rw-r--r--src/ops.c1
-rw-r--r--src/testdir/test_increment.in24
-rw-r--r--src/testdir/test_increment.ok9
-rw-r--r--src/version.c2
4 files changed, 35 insertions, 1 deletions
diff --git a/src/ops.c b/src/ops.c
index f53567bc..62d88a78 100644
--- 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
index fb7e6e3e..ecbc6f99 100644
--- 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
index 685478e6..48e722f0 100644
--- a/src/testdir/test_increment.ok
+++ b/src/testdir/test_increment.ok
@@ -271,6 +271,15 @@ E19====
2a
+# Test 20
+S20====
+a
+E20====
+
+b
+1
+
+
ENDTEST
diff --git a/src/version.c b/src/version.c
index 62eb4ed4..c2fd979c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 823,
+/**/
822,
/**/
821,