mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.848
Problem: CTRL-A on hex number in Visual block mode is incorrect.
Solution: Account for the "0x". (Hirohito Higashi)
5adfea1ac6
This commit is contained in:
parent
61a3b14726
commit
1e94262efe
@ -1862,6 +1862,9 @@ void vim_str2nr(char_u *start, int *prep, int *len,
|
|||||||
}
|
}
|
||||||
} else if ((pre == 'X') || (pre == 'x') || dohex > 1) {
|
} else if ((pre == 'X') || (pre == 'x') || dohex > 1) {
|
||||||
// hex
|
// hex
|
||||||
|
if (pre != 0) {
|
||||||
|
n += 2; // skip over "0x"
|
||||||
|
}
|
||||||
while (ascii_isxdigit(*ptr)) {
|
while (ascii_isxdigit(*ptr)) {
|
||||||
un = 16 * un + (unsigned long)hex2nr(*ptr);
|
un = 16 * un + (unsigned long)hex2nr(*ptr);
|
||||||
ptr++;
|
ptr++;
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -280,6 +280,14 @@ b
|
|||||||
1
|
1
|
||||||
|
|
||||||
|
|
||||||
|
# Test 21
|
||||||
|
S21====
|
||||||
|
0x123456
|
||||||
|
E21====
|
||||||
|
|
||||||
|
0x124456
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ static int included_patches[] = {
|
|||||||
// 851 NA
|
// 851 NA
|
||||||
// 850 NA
|
// 850 NA
|
||||||
849,
|
849,
|
||||||
// 848,
|
848,
|
||||||
// 847,
|
// 847,
|
||||||
// 846 NA
|
// 846 NA
|
||||||
// 845,
|
// 845,
|
||||||
|
Loading…
Reference in New Issue
Block a user