patch 7.4.848
Problem: CTRL-A on hex number in Visual block mode is incorrect.
Solution: Account for the "0x". (Hirohito Higashi)
diff --git a/src/charset.c b/src/charset.c
index 327fa03..a74bf0d 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1909,6 +1909,8 @@
else if (hex != 0 || dohex > 1)
{
/* hex */
+ if (hex != 0)
+ n += 2; /* skip over "0x" */
while (vim_isxdigit(*ptr))
{
un = 16 * un + (unsigned long)hex2nr(*ptr);
diff --git a/src/testdir/test_increment.in b/src/testdir/test_increment.in
index ecbc6f9..2ae6b8a 100644
--- a/src/testdir/test_increment.in
+++ b/src/testdir/test_increment.in
@@ -277,7 +277,15 @@
Expected:
1) <Ctrl-a> and cursor is on a
b
-
+
+21) block-wise increment on part of hexadecimal
+Text:
+0x123456
+
+ Expected:
+ 1) Ctrl-V f3 <ctrl-a>
+0x124456
+
STARTTEST
@@ -401,6 +409,12 @@
:.put =col('.')
:set nrformats&vim
+:" Test 21
+:/^S21=/+,/^E21=/-y a
+:/^E21=/+put a
+:set nrformats&vim
+f3
+
:" Save the report
:/^# Test 1/,$w! test.out
:qa!
@@ -594,6 +608,13 @@
+# Test 21
+S21====
+0x123456
+E21====
+
+
+
ENDTEST
diff --git a/src/testdir/test_increment.ok b/src/testdir/test_increment.ok
index 48e722f..15d0e9b 100644
--- a/src/testdir/test_increment.ok
+++ b/src/testdir/test_increment.ok
@@ -280,6 +280,14 @@
1
+# Test 21
+S21====
+0x123456
+E21====
+
+0x124456
+
+
ENDTEST
diff --git a/src/version.c b/src/version.c
index 1a5e237..b50521b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 848,
+/**/
847,
/**/
846,