diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-01-10 23:34:13 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-01-11 10:55:43 +0100 |
commit | 889f73e8618458ed46050e26cac0dee30a19b4f4 (patch) | |
tree | 596385945c7a0050189d7f0f89880fdee5a4b8a7 /src/nvim/edit.c | |
parent | 3f10c5b5338fc7efec53a23427e1c0e2dea56be4 (diff) | |
download | rneovim-889f73e8618458ed46050e26cac0dee30a19b4f4.tar.gz rneovim-889f73e8618458ed46050e26cac0dee30a19b4f4.tar.bz2 rneovim-889f73e8618458ed46050e26cac0dee30a19b4f4.zip |
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()
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 50c28dbaad..5e559462bc 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -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 */ } |