mirror of
https://github.com/neovim/neovim.git
synced 2025-10-11 20:36:35 +00:00
vim-patch:7.4.1896 (#5258)
Problem: Invoking mark_adjust() when adding a new line below the last line
is pointless.
Solution: Skip calling mark_adjust() when appending below the last line.
82faa259cc
This commit is contained in:

committed by
Justin M. Keyes

parent
10a54ad12e
commit
7fd771619f
@@ -3110,8 +3110,13 @@ error:
|
||||
if (dir == FORWARD)
|
||||
curbuf->b_op_start.lnum++;
|
||||
}
|
||||
mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise),
|
||||
(linenr_T)MAXLNUM, nr_lines, 0L);
|
||||
// Skip mark_adjust when adding lines after the last one, there
|
||||
// can't be marks there.
|
||||
if (curbuf->b_op_start.lnum + (y_type == kMTCharWise) - 1 + nr_lines
|
||||
< curbuf->b_ml.ml_line_count) {
|
||||
mark_adjust(curbuf->b_op_start.lnum + (y_type == kMTCharWise),
|
||||
(linenr_T)MAXLNUM, nr_lines, 0L);
|
||||
}
|
||||
|
||||
// note changed text for displaying and folding
|
||||
if (y_type == kMTCharWise) {
|
||||
|
Reference in New Issue
Block a user