diff options
author | watiko <service@mail.watiko.net> | 2016-01-14 21:43:26 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-01 03:43:37 +0900 |
commit | 1e94262efe6e059103698365d82ba02d6172dc57 (patch) | |
tree | 6a9909b132e9a8ce98ff2824b018c26431f33e07 | |
parent | 61a3b14726fe54ac6a8949cad79a91ce9b6739a9 (diff) | |
download | rneovim-1e94262efe6e059103698365d82ba02d6172dc57.tar.gz rneovim-1e94262efe6e059103698365d82ba02d6172dc57.tar.bz2 rneovim-1e94262efe6e059103698365d82ba02d6172dc57.zip |
vim-patch:7.4.848
Problem: CTRL-A on hex number in Visual block mode is incorrect.
Solution: Account for the "0x". (Hirohito Higashi)
https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
-rw-r--r-- | src/nvim/charset.c | 3 | ||||
-rw-r--r-- | src/nvim/testdir/test_increment.in | 23 | ||||
-rw-r--r-- | src/nvim/testdir/test_increment.ok | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 34 insertions, 2 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index e689af0c82..02d4baaaef 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1862,6 +1862,9 @@ void vim_str2nr(char_u *start, int *prep, int *len, } } else if ((pre == 'X') || (pre == 'x') || dohex > 1) { // hex + if (pre != 0) { + n += 2; // skip over "0x" + } while (ascii_isxdigit(*ptr)) { un = 16 * un + (unsigned long)hex2nr(*ptr); ptr++; diff --git a/src/nvim/testdir/test_increment.in b/src/nvim/testdir/test_increment.in index ecbc6f99a1..2ae6b8a563 100644 --- a/src/nvim/testdir/test_increment.in +++ b/src/nvim/testdir/test_increment.in @@ -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.. :.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/nvim/testdir/test_increment.ok b/src/nvim/testdir/test_increment.ok index 48e722f038..15d0e9b50b 100644 --- a/src/nvim/testdir/test_increment.ok +++ b/src/nvim/testdir/test_increment.ok @@ -280,6 +280,14 @@ b 1 +# Test 21 +S21==== +0x123456 +E21==== + +0x124456 + + ENDTEST diff --git a/src/nvim/version.c b/src/nvim/version.c index 937d1e0cbb..ed58396329 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -286,7 +286,7 @@ static int included_patches[] = { // 851 NA // 850 NA 849, - // 848, + 848, // 847, // 846 NA // 845, |