mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 20:38:18 +00:00
move appended_lines_mark
This commit is contained in:
@@ -341,18 +341,14 @@ void appended_lines(linenr_T lnum, long count)
|
|||||||
/*
|
/*
|
||||||
* Like appended_lines(), but adjust marks first.
|
* Like appended_lines(), but adjust marks first.
|
||||||
*/
|
*/
|
||||||
void
|
void appended_lines_mark(linenr_T lnum, long count)
|
||||||
appended_lines_mark(linenr_T lnum, long count)
|
|
||||||
{
|
{
|
||||||
// Skip mark_adjust when adding a line after the last one, there can't
|
// Skip mark_adjust when adding a line after the last one, there can't
|
||||||
// be marks there. But it's still needed in diff mode.
|
// be marks there. But it's still needed in diff mode.
|
||||||
if (lnum + count < curbuf->b_ml.ml_line_count
|
if (lnum + count < curbuf->b_ml.ml_line_count || curwin->w_p_diff) {
|
||||||
#ifdef FEAT_DIFF
|
mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L, false);
|
||||||
|| curwin->w_p_diff
|
}
|
||||||
#endif
|
changed_lines(lnum + 1, 0, lnum + 1, count, true);
|
||||||
)
|
|
||||||
mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L);
|
|
||||||
changed_lines(lnum + 1, 0, lnum + 1, count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1785,19 +1785,6 @@ int gchar_pos(pos_T *pos)
|
|||||||
return utf_ptr2char(ml_get_pos(pos));
|
return utf_ptr2char(ml_get_pos(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Like appended_lines(), but adjust marks first.
|
|
||||||
*/
|
|
||||||
void appended_lines_mark(linenr_T lnum, long count)
|
|
||||||
{
|
|
||||||
// Skip mark_adjust when adding a line after the last one, there can't
|
|
||||||
// be marks there. But it's still needed in diff mode.
|
|
||||||
if (lnum + count < curbuf->b_ml.ml_line_count || curwin->w_p_diff) {
|
|
||||||
mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L, false);
|
|
||||||
}
|
|
||||||
changed_lines(lnum + 1, 0, lnum + 1, count, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Deleted "count" lines at line "lnum" in the current buffer.
|
* Deleted "count" lines at line "lnum" in the current buffer.
|
||||||
* Must be called AFTER the change and after mark_adjust().
|
* Must be called AFTER the change and after mark_adjust().
|
||||||
|
Reference in New Issue
Block a user