diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-01 10:49:14 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-01 10:49:14 +0800 |
| commit | 2268a4147ec1e9f0236fd5eb56c1cc2b751eca05 (patch) | |
| tree | e85448107d27109df805e865053468e199956dbe /src/nvim/screen.c | |
| parent | 5a490d838ed3288abcf45e16e6ab79c326a67c17 (diff) | |
| parent | 5a62ad605e4945562d5defb5eb6a2e8a88107ebf (diff) | |
| download | rneovim-2268a4147ec1e9f0236fd5eb56c1cc2b751eca05.tar.gz rneovim-2268a4147ec1e9f0236fd5eb56c1cc2b751eca05.tar.bz2 rneovim-2268a4147ec1e9f0236fd5eb56c1cc2b751eca05.zip | |
Merge pull request #19170 from zeertzjq/vim-8.0.1558
vim-patch:8.0.{1558,1570,1574,1588},8.1.{0487,0695,1274}: menu features
Diffstat (limited to 'src/nvim/screen.c')
| -rw-r--r-- | src/nvim/screen.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index bc11883fd8..c2a88bb4a6 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -298,6 +298,13 @@ void redraw_win_signcol(win_T *wp) } } +/// Update all windows that are editing the current buffer. +void update_curbuf(int type) +{ + redraw_curbuf_later(type); + update_screen(type); +} + /// Redraw the parts of the screen that is marked for redraw. /// /// Most code shouldn't call this directly, rather use redraw_later() and @@ -5750,12 +5757,17 @@ static void linecopy(ScreenGrid *grid, int to, int from, int col, int width) width * sizeof(sattr_T)); } -/* - * Set cursor to its position in the current window. - */ +/// Set cursor to its position in the current window. void setcursor(void) { - if (redrawing()) { + setcursor_mayforce(false); +} + +/// Set cursor to its position in the current window. +/// @param force when true, also when not redrawing. +void setcursor_mayforce(bool force) +{ + if (force || redrawing()) { validate_cursor(); ScreenGrid *grid = &curwin->w_grid; |