aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-09-26 15:17:10 +0200
committerbfredl <bjorn.linse@gmail.com>2022-10-05 20:11:13 +0200
commit6679687bb3909f853ae97dfa01ae08ea2baf7f97 (patch)
treeeba4f499d8521853bb56cadecf19f0d85cac1d9a /src/nvim/ex_getln.c
parent1f2ded459a6f26635bf013da4100b3dedb777f73 (diff)
downloadrneovim-6679687bb3909f853ae97dfa01ae08ea2baf7f97.tar.gz
rneovim-6679687bb3909f853ae97dfa01ae08ea2baf7f97.tar.bz2
rneovim-6679687bb3909f853ae97dfa01ae08ea2baf7f97.zip
refactor(redraw): no type argument in update_screen()
This was used in the past with assumption that curwin/curbuf is "special" but this has not been true since basically forever at this point. Reduce NOT_VALID/CLEAR panic in options.lua . These should not be set if an effect of the option is causing something which by itself invokes redraw_later().
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 4b54b58ac1..d1d0fe3f2a 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -501,7 +501,8 @@ static void may_do_incsearch_highlighting(int firstc, long count, incsearch_stat
curwin->w_redr_status = true;
}
- update_screen(UPD_SOME_VALID);
+ redraw_later(curwin, UPD_SOME_VALID);
+ update_screen();
highlight_match = false;
restore_last_search_pattern();
@@ -588,7 +589,7 @@ static void finish_incsearch_highlighting(int gotesc, incsearch_state_T *s, bool
validate_cursor(); // needed for TAB
redraw_all_later(UPD_SOME_VALID);
if (call_update_screen) {
- update_screen(UPD_SOME_VALID);
+ update_screen();
}
}
}
@@ -1376,7 +1377,8 @@ static int may_do_command_line_next_incsearch(int firstc, long count, incsearch_
validate_cursor();
highlight_match = true;
save_viewstate(curwin, &s->old_viewstate);
- update_screen(UPD_NOT_VALID);
+ redraw_later(curwin, UPD_NOT_VALID);
+ update_screen();
highlight_match = false;
redrawcmdline();
curwin->w_cursor = s->match_end;
@@ -2336,7 +2338,7 @@ static bool cmdpreview_may_show(CommandLineState *s)
if (cmdpreview_type != 0) {
int save_rd = RedrawingDisabled;
RedrawingDisabled = 0;
- update_screen(UPD_SOME_VALID);
+ update_screen();
RedrawingDisabled = save_rd;
}
@@ -2406,7 +2408,9 @@ static int command_line_changed(CommandLineState *s)
} else {
cmdpreview = false;
if (prev_cmdpreview) {
- update_screen(UPD_SOME_VALID); // Clear 'inccommand' preview.
+ // TODO(bfredl): add an immediate redraw flag for cmdline mode which will trigger
+ // at next wait-for-input
+ update_screen(); // Clear 'inccommand' preview.
}
if (s->xpc.xp_context == EXPAND_NOTHING && (KeyTyped || vpeekc() == NUL)) {
may_do_incsearch_highlighting(s->firstc, s->count, &s->is_state);