mirror of
https://github.com/neovim/neovim.git
synced 2026-05-01 03:24:49 +00:00
@@ -1990,8 +1990,7 @@ buf_T *buflist_new(char *ffname_arg, char *sfname_arg, linenr_T lnum, int flags)
|
||||
pmap_put(int)(&buffer_handles, buf->b_fnum, buf);
|
||||
if (top_file_num < 0) { // wrap around (may cause duplicates)
|
||||
emsg(_("W14: Warning: List of file names overflow"));
|
||||
if (emsg_silent == 0 && !in_assert_fails && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
if (emsg_silent == 0 && !in_assert_fails) {
|
||||
msg_delay(3001, true); // make sure it is noticed
|
||||
}
|
||||
top_file_num = 1;
|
||||
|
||||
@@ -92,8 +92,7 @@ void change_warning(buf_T *buf, int col)
|
||||
set_vim_var_string(VV_WARNINGMSG, _(w_readonly), -1);
|
||||
msg_clr_eos();
|
||||
msg_end();
|
||||
if (msg_silent == 0 && !silent_mode && ui_active() && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
if (msg_silent == 0 && !silent_mode && ui_active()) {
|
||||
msg_delay(1002, true); // give the user time to think about it
|
||||
}
|
||||
buf->b_did_warn = true;
|
||||
@@ -132,7 +131,6 @@ void changed(buf_T *buf)
|
||||
// message. Since we could be anywhere, call wait_return() now,
|
||||
// and don't let the emsg() set msg_scroll.
|
||||
if (need_wait_return && emsg_silent == 0 && !in_assert_fails && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
msg_delay(2002, true);
|
||||
wait_return(true);
|
||||
msg_scroll = save_msg_scroll;
|
||||
|
||||
@@ -3028,12 +3028,8 @@ int buf_check_timestamp(buf_T *buf)
|
||||
msg_clr_eos();
|
||||
msg_end();
|
||||
if (emsg_silent == 0 && !in_assert_fails && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
// give the user some time to think about it
|
||||
msg_delay(1004, true);
|
||||
|
||||
// don't redraw and erase the message
|
||||
redraw_cmdline = false;
|
||||
msg_delay(1004, true); // give the user some time to think about it
|
||||
redraw_cmdline = false; // don't redraw and erase the message
|
||||
}
|
||||
}
|
||||
already_warned = true;
|
||||
|
||||
@@ -552,10 +552,7 @@ bool check_compl_option(bool dict_opt)
|
||||
if (emsg_silent == 0 && !in_assert_fails) {
|
||||
vim_beep(kOptBoFlagComplete);
|
||||
setcursor();
|
||||
if (!ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
msg_delay(2004, false);
|
||||
}
|
||||
msg_delay(2004, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3923,17 +3923,22 @@ int vim_dialog_yesnoallcancel(int type, char *title, char *message, int dflt)
|
||||
return VIM_CANCEL;
|
||||
}
|
||||
|
||||
/// Force the user to see a message by pausing for `ms` milliseconds.
|
||||
/// Only for legacy UI (`!ui_has(kUIMessages)`): Pause to display a message for `ms` milliseconds.
|
||||
///
|
||||
/// TODO(justinmk): Most of these cases may not be needed after "ui2"...
|
||||
void msg_delay(uint64_t ms, bool ignoreinput)
|
||||
{
|
||||
if (ui_has(kUIMessages)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nvim_testing) {
|
||||
// XXX: Skip non-functional (UI only) delay in tests/CI.
|
||||
ms = 100;
|
||||
}
|
||||
|
||||
DLOG("%" PRIu64 " ms%s", ms, nvim_testing ? " (skipped by NVIM_TEST)" : "");
|
||||
ui_flush();
|
||||
os_delay(ms, ignoreinput);
|
||||
}
|
||||
|
||||
@@ -3944,7 +3949,6 @@ void msg_check_for_delay(bool check_msg_scroll)
|
||||
{
|
||||
if ((emsg_on_display || (check_msg_scroll && msg_scroll))
|
||||
&& !did_wait_return && emsg_silent == 0 && !in_assert_fails && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
msg_delay(1006, true);
|
||||
emsg_on_display = false;
|
||||
if (check_msg_scroll) {
|
||||
|
||||
@@ -701,7 +701,7 @@ static void normal_redraw_mode_message(NormalState *s)
|
||||
setcursor();
|
||||
ui_cursor_shape(); // show different cursor shape
|
||||
ui_flush();
|
||||
if (!ui_has(kUIMessages) && (msg_scroll || emsg_on_display)) {
|
||||
if (msg_scroll || emsg_on_display) {
|
||||
msg_delay(1003, true); // wait at least one second
|
||||
}
|
||||
if (ui_has(kUIMessages)) {
|
||||
|
||||
@@ -742,8 +742,7 @@ void do_tag(char *tag, int type, int count, int forceit, bool verbose)
|
||||
} else {
|
||||
give_warning(IObuff, ic, true);
|
||||
}
|
||||
if (ic && !msg_scrolled && msg_silent == 0 && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
if (ic && !msg_scrolled && msg_silent == 0) {
|
||||
msg_delay(1007, true);
|
||||
}
|
||||
}
|
||||
@@ -2981,8 +2980,7 @@ static int jumpto_tag(const char *lbuf_arg, int forceit, bool keep_help)
|
||||
// is set and match found while ignoring case.
|
||||
if (found == 2 || !save_p_ic) {
|
||||
msg(_("E435: Couldn't find tag, just guessing!"), 0);
|
||||
if (!msg_scrolled && msg_silent == 0 && !ui_has(kUIMessages)) {
|
||||
ui_flush();
|
||||
if (!msg_scrolled && msg_silent == 0) {
|
||||
msg_delay(1010, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user