On Mo, 27 Jul 2015, h_east wrote:
> Since this version, visual block <C-A>/<C-X> is no longer working, when
> 'nrformats' option contains the 'alpha'.
>
> Is this the intended modification?
>
>
> How to reproduce:
> $ vim -N -u NONE
> i1<Esc>
> <C-V><C-A> " Increment to 2
> :set nrformats+=alpha
> <C-V><C-A> " Does not increment
>
> Thanks.
Here is a patch.
Best,
Christian
--
Erst wenn ein Anzug abgetragen ist, beginnt seine Glanzzeit.
-- Heinz Rühmann
--
--
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
@@ -5519,12 +5519,14 @@ do_addsub(command, Prenum1, g_cmd)
&& vim_isdigit(ptr[col+1]))) && ptr[col])
col++;
}
- }
- if (visual && ptr[col] == '-')
- {
- negative = TRUE;
- was_positive = FALSE;
- col++;
+ if (ptr[col] == '-')
+ {
+ negative = TRUE;
+ was_positive = FALSE;
+ col++;
+ }
+ else if (ptr[col] == NUL)
+ col = startcol;
}
/*
* If a number was found, and saving for undo works, replace the number.
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
@@ -260,6 +260,16 @@ Text:
9
12
+19) increment on number with nrformat including alpha
+Text:
+ 1
+ 1a
+
+ Expected:
+ 1) <Ctrl-V>j$ <ctrl-a>
+ 2
+ 1b
+
STARTTEST
@@ -369,6 +379,13 @@ 4kj$2j.
:/^E18=/+put a
V3kg..
+:" Test 19
+:set nrformats+=alpha
+:/^S19=/+,/^E19=/-y a
+:/^E19=/+put a
+k$
+:set nrformats&vim
+
:" Save the report
:/^# Test 1/,$w! test.out
:qa!
@@ -547,6 +564,13 @@ E18====
+# Test 19
+S19====
+1
+1a
+E19====
+
+
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
@@ -261,6 +261,15 @@ 9
12
+# Test 19
+S19====
+1
+1a
+E19====
+
+2
+1b
+
ENDTEST