screen: make update_screen() the only entry point for redrawing

update_single_line() was only used for 'concealcursor'. But 'cursorline'
has very similiar characteristics (redraw both lines on move cursor
between lines) and works without its own special entry point to the
redraw subsystem.

Later on 'concealcursor' and 'cursorline' could share more logic, but for
now make the former use standard redrawWinline(). Make sure it is called
before update_screen(), so that it is immediately visible.

Get rid of update_prepare() and update_finish(), and all issues from
them and their callsites not being in sync with changes to
update_screen()
This commit is contained in:
Björn Linse
2019-01-10 23:34:13 +01:00
parent 3f10c5b533
commit 889f73e861
4 changed files with 39 additions and 83 deletions

View File

@@ -1452,21 +1452,24 @@ ins_redraw (
}
}
if (must_redraw)
update_screen(0);
else if (clear_cmdline || redraw_cmdline)
showmode(); /* clear cmdline and show mode */
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)
update_single_line(curwin, conceal_old_cursor_line);
update_single_line(curwin, conceal_new_cursor_line == 0
? curwin->w_cursor.lnum : conceal_new_cursor_line);
if (conceal_old_cursor_line != conceal_new_cursor_line) {
redrawWinline(curwin, conceal_old_cursor_line);
}
redrawWinline(curwin, conceal_new_cursor_line == 0
? curwin->w_cursor.lnum : conceal_new_cursor_line);
curwin->w_valid &= ~VALID_CROW;
}
showruler(FALSE);
if (must_redraw) {
update_screen(0);
} else if (clear_cmdline || redraw_cmdline) {
showmode(); // clear cmdline and show mode
}
showruler(false);
setcursor();
emsg_on_display = FALSE; /* may remove error message now */
}