]> granicus.if.org Git - vim/commitdiff
patch 7.4.848 v7.4.848
authorBram Moolenaar <Bram@vim.org>
Tue, 1 Sep 2015 16:51:39 +0000 (18:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 1 Sep 2015 16:51:39 +0000 (18:51 +0200)
Problem:    CTRL-A on hex number in Visual block mode is incorrect.
Solution:   Account for the "0x". (Hirohito Higashi)

src/charset.c
src/testdir/test_increment.in
src/testdir/test_increment.ok
src/version.c

index 327fa0375a6004d1822b88321b0cb77d95585615..a74bf0d5bf705a091cdb009f39f221e4fe4e4792 100644 (file)
@@ -1909,6 +1909,8 @@ vim_str2nr(start, hexp, len, dooct, dohex, nptr, unptr, maxlen)
     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);
index ecbc6f99a13ac3a0b458d729c1e2dae96429a418..2ae6b8a56395be276bd2eb8d84742aa30a9060f1 100644 (file)
@@ -277,7 +277,15 @@ Text:
  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 @@ V3kg\ 1..
 \ 1:.put =col('.')
 :set nrformats&vim
 
+:" Test 21
+:/^S21=/+,/^E21=/-y a
+:/^E21=/+put a
+:set nrformats&vim
+\16f3\ 1
+
 :" Save the report
 :/^# Test 1/,$w! test.out
 :qa!
@@ -594,6 +608,13 @@ E20====
 
 
 
+# Test 21
+S21====
+0x123456
+E21====
+
+
+
 
 ENDTEST
 
index 48e722f038eadd20197f02e70f91d8b1abb76aa2..15d0e9b50bbf43c4b0832338541e998accca920a 100644 (file)
@@ -280,6 +280,14 @@ b
 1
 
 
+# Test 21
+S21====
+0x123456
+E21====
+
+0x124456
+
+
 
 ENDTEST
 
index 1a5e2376481f82092f1efb32b7614563103e8a52..b50521b626117bedeae9e142b4f7bca56201b5b2 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    848,
 /**/
     847,
 /**/