mirror of
https://github.com/neovim/neovim.git
synced 2026-05-05 13:35:02 +00:00
ops: Fix PVS/V547: did_change is almost always set
Only exception is early `goto theend`.
This commit is contained in:
@@ -4610,9 +4610,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1)
|
||||
}
|
||||
}
|
||||
curwin->w_cursor.col = col;
|
||||
if (!did_change) {
|
||||
startpos = curwin->w_cursor;
|
||||
}
|
||||
startpos = curwin->w_cursor;
|
||||
did_change = true;
|
||||
(void)del_char(false);
|
||||
ins_char(firstdigit);
|
||||
@@ -4687,9 +4685,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1)
|
||||
|
||||
// Delete the old number.
|
||||
curwin->w_cursor.col = col;
|
||||
if (!did_change) {
|
||||
startpos = curwin->w_cursor;
|
||||
}
|
||||
startpos = curwin->w_cursor;
|
||||
did_change = true;
|
||||
todel = length;
|
||||
c = gchar_cursor();
|
||||
@@ -4775,18 +4771,16 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1)
|
||||
ins_str(buf1); // insert the new number
|
||||
xfree(buf1);
|
||||
endpos = curwin->w_cursor;
|
||||
if (did_change && curwin->w_cursor.col) {
|
||||
if (curwin->w_cursor.col) {
|
||||
curwin->w_cursor.col--;
|
||||
}
|
||||
}
|
||||
|
||||
if (did_change) {
|
||||
// set the '[ and '] marks
|
||||
curbuf->b_op_start = startpos;
|
||||
curbuf->b_op_end = endpos;
|
||||
if (curbuf->b_op_end.col > 0) {
|
||||
curbuf->b_op_end.col--;
|
||||
}
|
||||
// set the '[ and '] marks
|
||||
curbuf->b_op_start = startpos;
|
||||
curbuf->b_op_end = endpos;
|
||||
if (curbuf->b_op_end.col > 0) {
|
||||
curbuf->b_op_end.col--;
|
||||
}
|
||||
|
||||
theend:
|
||||
|
||||
Reference in New Issue
Block a user