0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.848

Problem:    CTRL-A on hex number in Visual block mode is incorrect.
Solution:   Account for the "0x". (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2015-09-01 18:51:39 +02:00
parent 8667d66ca9
commit 5adfea1ac6
4 changed files with 34 additions and 1 deletions

View File

@@ -1909,6 +1909,8 @@ vim_str2nr(start, hexp, len, dooct, dohex, nptr, unptr, maxlen)
else if (hex != 0 || dohex > 1) else if (hex != 0 || dohex > 1)
{ {
/* hex */ /* hex */
if (hex != 0)
n += 2; /* skip over "0x" */
while (vim_isxdigit(*ptr)) while (vim_isxdigit(*ptr))
{ {
un = 16 * un + (unsigned long)hex2nr(*ptr); un = 16 * un + (unsigned long)hex2nr(*ptr);

View File

@@ -278,6 +278,14 @@ Text:
1) <Ctrl-a> and cursor is on a 1) <Ctrl-a> and cursor is on a
b b
21) block-wise increment on part of hexadecimal
Text:
0x123456
Expected:
1) Ctrl-V f3 <ctrl-a>
0x124456
STARTTEST STARTTEST
@@ -401,6 +409,12 @@ V3kg..
:.put =col('.') :.put =col('.')
:set nrformats&vim :set nrformats&vim
:" Test 21
:/^S21=/+,/^E21=/-y a
:/^E21=/+put a
:set nrformats&vim
f3
:" Save the report :" Save the report
:/^# Test 1/,$w! test.out :/^# Test 1/,$w! test.out
:qa! :qa!
@@ -594,6 +608,13 @@ E20====
# Test 21
S21====
0x123456
E21====
ENDTEST ENDTEST

View File

@@ -280,6 +280,14 @@ b
1 1
# Test 21
S21====
0x123456
E21====
0x124456
ENDTEST ENDTEST

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
848,
/**/ /**/
847, 847,
/**/ /**/