aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-09-13 12:56:30 +0200
committerbfredl <bjorn.linse@gmail.com>2022-09-15 12:13:43 +0200
commit708bd686516b420c2b65f4bc4d2c58fe43fb945e (patch)
treedceae7b5fc616d7cfec138e5291d664ec7ba451e /src/nvim/ex_cmds.c
parentbf6de51f55c1b812342c7d4e88c65a7cae7fe97f (diff)
downloadrneovim-708bd686516b420c2b65f4bc4d2c58fe43fb945e.tar.gz
rneovim-708bd686516b420c2b65f4bc4d2c58fe43fb945e.tar.bz2
rneovim-708bd686516b420c2b65f4bc4d2c58fe43fb945e.zip
feat(ui): use msg_grid based implementation for cmdheight=0
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 2cc64918a3..462212c4ce 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -3616,13 +3616,6 @@ static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T
}
}
- const bool cmdheight0 = !ui_has_messages();
- if (cmdheight0) {
- // If cmdheight is 0, cmdheight must be set to 1 when we enter command line.
- set_option_value("ch", 1L, NULL, 0);
- redraw_statuslines();
- }
-
// Check for a match on each line.
// If preview: limit to max('cmdwinheight', viewport).
linenr_T line2 = eap->line2;
@@ -3914,7 +3907,9 @@ static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T
msg_no_more = false;
msg_scroll = (int)i;
show_cursor_info(true);
- ui_cursor_goto(msg_row, msg_col);
+ if (!ui_has(kUIMessages)) {
+ ui_cursor_goto(msg_row, msg_col);
+ }
RedrawingDisabled = temp;
no_mapping++; // don't map this key
@@ -4370,7 +4365,7 @@ skip:
beginline(BL_WHITE | BL_FIX);
}
}
- if (!cmdpreview && !do_sub_msg(subflags.do_count) && subflags.do_ask) {
+ if (!cmdpreview && !do_sub_msg(subflags.do_count) && subflags.do_ask && p_ch > 0) {
msg("");
}
} else {
@@ -4385,7 +4380,9 @@ skip:
emsg(_(e_interr));
} else if (got_match) {
// did find something but nothing substituted
- msg("");
+ if (p_ch > 0) {
+ msg("");
+ }
} else if (subflags.do_error) {
// nothing found
semsg(_(e_patnotf2), get_search_pat());
@@ -4418,11 +4415,6 @@ skip:
}
}
- if (cmdheight0) {
- // Restore cmdheight
- set_option_value("ch", 0L, NULL, 0);
- }
-
kv_destroy(preview_lines.subresults);
return retv;
#undef ADJUST_SUB_FIRSTLNUM