aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/ops.c1
-rw-r--r--src/nvim/testdir/test_increment.in24
-rw-r--r--src/nvim/testdir/test_increment.ok9
-rw-r--r--src/nvim/version.c2
4 files changed, 34 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index d22dcad020..e88d1d611c 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -4416,6 +4416,7 @@ int do_addsub(int command, linenr_T Prenum1, bool g_cmd)
did_change = true;
(void)del_char(false);
ins_char(firstdigit);
+ curwin->w_cursor.col = col;
} else {
if (col > 0 && ptr[col - 1] == '-' && !visual) {
// negative number
diff --git a/src/nvim/testdir/test_increment.in b/src/nvim/testdir/test_increment.in
index fb7e6e3ee2..ecbc6f99a1 100644
--- a/src/nvim/testdir/test_increment.in
+++ b/src/nvim/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/nvim/testdir/test_increment.ok b/src/nvim/testdir/test_increment.ok
index 685478e668..48e722f038 100644
--- a/src/nvim/testdir/test_increment.ok
+++ b/src/nvim/testdir/test_increment.ok
@@ -271,6 +271,15 @@ E19====
2a
+# Test 20
+S20====
+a
+E20====
+
+b
+1
+
+
ENDTEST
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e41d1ff7ce..937d1e0cbb 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -311,7 +311,7 @@ static int included_patches[] = {
826,
// 825,
// 824 NA
- // 823,
+ 823,
// 822,
// 821,
// 820,