1
0
forked from aniani/vim

patch 7.4.1896

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.
This commit is contained in:
Bram Moolenaar
2016-06-04 20:14:07 +02:00
parent 888ccac890
commit 82faa259cc
3 changed files with 16 additions and 4 deletions

View File

@@ -3885,7 +3885,11 @@ error:
if (dir == FORWARD)
curbuf->b_op_start.lnum++;
}
mark_adjust(curbuf->b_op_start.lnum + (y_type == MCHAR),
/* Skip mark_adjust when adding lines after the last one, there
* can't be marks there. */
if (curbuf->b_op_start.lnum + (y_type == MCHAR) - 1 + nr_lines
< curbuf->b_ml.ml_line_count)
mark_adjust(curbuf->b_op_start.lnum + (y_type == MCHAR),
(linenr_T)MAXLNUM, nr_lines, 0L);
/* note changed text for displaying and folding */