mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.806
Problem: CTRL-A in Visual mode doesn't work properly with "alpha" in
'nrformat'.
Solution: Make it work. (Christian Brabandt)
cc218ab3ca
This commit is contained in:
parent
43fd126298
commit
d21aaef456
@ -4340,6 +4340,8 @@ int do_addsub(int command, linenr_T Prenum1, bool g_cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = lnum; i <= lnume; i++) {
|
for (int i = lnum; i <= lnume; i++) {
|
||||||
|
colnr_T stop = 0;
|
||||||
|
|
||||||
t = curwin->w_cursor;
|
t = curwin->w_cursor;
|
||||||
curwin->w_cursor.lnum = i;
|
curwin->w_cursor.lnum = i;
|
||||||
ptr = get_cursor_line_ptr();
|
ptr = get_cursor_line_ptr();
|
||||||
@ -4349,31 +4351,26 @@ int do_addsub(int command, linenr_T Prenum1, bool g_cmd)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (visual) {
|
if (visual) {
|
||||||
if (doalp) {
|
if (VIsual_mode == 'v' && i == lnume) {
|
||||||
// search for ascii chars
|
stop = curwin->w_cursor.col;
|
||||||
while (!ASCII_ISALPHA(ptr[col]) && ptr[col]) {
|
} else if (VIsual_mode == Ctrl_V &&
|
||||||
col++;
|
curbuf->b_visual.vi_curswant != MAXCOL) {
|
||||||
}
|
stop = curwin->w_cursor.col;
|
||||||
} else if (dohex) {
|
}
|
||||||
// skip to first digit, but allow for leading '-'
|
|
||||||
while (!(ascii_isxdigit(ptr[col])
|
while (ptr[col] != NUL
|
||||||
|| (ptr[col] == '-' && ascii_isxdigit(ptr[col + 1])))
|
&& !ascii_isdigit(ptr[col])
|
||||||
&& ptr[col]) {
|
&& !(doalp && ASCII_ISALPHA(ptr[col]))) {
|
||||||
col++;
|
if (col > 0 && col == stop) {
|
||||||
}
|
break;
|
||||||
} else {
|
}
|
||||||
// decimal
|
col++;
|
||||||
while (!(ascii_isdigit(ptr[col])
|
}
|
||||||
|| (ptr[col] == '-' && ascii_isdigit(ptr[col + 1])))
|
|
||||||
&& ptr[col]) {
|
if (col > startcol && ptr[col - 1] == '-') {
|
||||||
col++;
|
negative = true;
|
||||||
}
|
was_positive = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (visual && ptr[col] == '-') {
|
|
||||||
negative = true;
|
|
||||||
was_positive = false;
|
|
||||||
col++;
|
|
||||||
}
|
}
|
||||||
// If a number was found, and saving for undo works, replace the number.
|
// If a number was found, and saving for undo works, replace the number.
|
||||||
firstdigit = ptr[col];
|
firstdigit = ptr[col];
|
||||||
|
@ -260,6 +260,16 @@ Text:
|
|||||||
9
|
9
|
||||||
12
|
12
|
||||||
|
|
||||||
|
19) increment on number with nrformat including alpha
|
||||||
|
Text:
|
||||||
|
1
|
||||||
|
1a
|
||||||
|
|
||||||
|
Expected:
|
||||||
|
1) <Ctrl-V>j$ <ctrl-a>
|
||||||
|
2
|
||||||
|
1b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
STARTTEST
|
STARTTEST
|
||||||
@ -369,6 +379,13 @@ V3k
|
|||||||
:/^E18=/+put a
|
:/^E18=/+put a
|
||||||
V3kg..
|
V3kg..
|
||||||
|
|
||||||
|
:" Test 19
|
||||||
|
:set nrformats+=alpha
|
||||||
|
:/^S19=/+,/^E19=/-y a
|
||||||
|
:/^E19=/+put a
|
||||||
|
k$
|
||||||
|
:set nrformats&vim
|
||||||
|
|
||||||
:" Save the report
|
:" Save the report
|
||||||
:/^# Test 1/,$w! test.out
|
:/^# Test 1/,$w! test.out
|
||||||
:qa!
|
:qa!
|
||||||
@ -547,6 +564,13 @@ E18====
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Test 19
|
||||||
|
S19====
|
||||||
|
1
|
||||||
|
1a
|
||||||
|
E19====
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
@ -261,6 +261,15 @@ E18====
|
|||||||
12
|
12
|
||||||
|
|
||||||
|
|
||||||
|
# Test 19
|
||||||
|
S19====
|
||||||
|
1
|
||||||
|
1a
|
||||||
|
E19====
|
||||||
|
|
||||||
|
2
|
||||||
|
2a
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
@ -328,7 +328,7 @@ static int included_patches[] = {
|
|||||||
809,
|
809,
|
||||||
// 808 NA
|
// 808 NA
|
||||||
// 807,
|
// 807,
|
||||||
// 806,
|
806,
|
||||||
// 805,
|
// 805,
|
||||||
// 804,
|
// 804,
|
||||||
803,
|
803,
|
||||||
|
Loading…
Reference in New Issue
Block a user