# HG changeset patch # User Christian Brabandt # Date 1441126804 -7200 # Node ID 05afb5be93bda6388da6418542e1dcc940e151e4 # Parent 9d559fd7c415bfb743734ba946cce76b324365b7 commit https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592 Author: Bram Moolenaar Date: Tue Sep 1 18:51:39 2015 +0200 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 --- a/src/charset.c +++ b/src/charset.c @@ -1909,6 +1909,8 @@ vim_str2nr(start, hexp, len, dooct, dohe 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 --- a/src/testdir/test_increment.in +++ b/src/testdir/test_increment.in @@ -277,7 +277,15 @@ Text: Expected: 1) and cursor is on a b - + +21) block-wise increment on part of hexadecimal +Text: +0x123456 + + Expected: + 1) Ctrl-V f3 +0x124456 + STARTTEST @@ -401,6 +409,12 @@ V3kg.. :.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 @@ E20==== +# Test 21 +S21==== +0x123456 +E21==== + + + 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 @@ -280,6 +280,14 @@ b 1 +# Test 21 +S21==== +0x123456 +E21==== + +0x124456 + + ENDTEST diff --git a/src/version.c b/src/version.c --- 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 */ /**/ + 848, +/**/ 847, /**/ 846,