0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.0726: redrawing specifically for conceal feature

Problem:    Redrawing specifically for conceal feature.
Solution:   Use generic redrawing methods.
This commit is contained in:
Bram Moolenaar
2019-01-11 20:45:36 +01:00
parent 465e8b5985
commit 535d5b653a
8 changed files with 36 additions and 82 deletions

View File

@@ -1194,6 +1194,22 @@ main_loop(
last_cursormoved = curwin->w_cursor;
}
#if defined(FEAT_CONCEAL)
if (conceal_update_lines
&& (conceal_old_cursor_line != conceal_new_cursor_line
|| conceal_cursor_line(curwin)
|| need_cursor_line_redraw))
{
if (conceal_old_cursor_line != conceal_new_cursor_line
&& conceal_old_cursor_line
<= curbuf->b_ml.ml_line_count)
redrawWinline(curwin, conceal_old_cursor_line);
redrawWinline(curwin, conceal_new_cursor_line);
curwin->w_valid &= ~VALID_CROW;
need_cursor_line_redraw = FALSE;
}
#endif
/* Trigger TextChanged if b:changedtick differs. */
if (!finish_op && has_textchanged()
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf))
@@ -1288,22 +1304,6 @@ main_loop(
may_clear_sb_text(); /* clear scroll-back text on next msg */
showruler(FALSE);
#if defined(FEAT_CONCEAL)
if (conceal_update_lines
&& (conceal_old_cursor_line != conceal_new_cursor_line
|| conceal_cursor_line(curwin)
|| need_cursor_line_redraw))
{
mch_disable_flush(); /* Stop issuing gui_mch_flush(). */
if (conceal_old_cursor_line != conceal_new_cursor_line
&& conceal_old_cursor_line
<= curbuf->b_ml.ml_line_count)
update_single_line(curwin, conceal_old_cursor_line);
update_single_line(curwin, conceal_new_cursor_line);
mch_enable_flush();
curwin->w_valid &= ~VALID_CROW;
}
#endif
setcursor();
cursor_on();