When starting Vim with a script that enters Visual mode (e.g. "vim -S script.vim"), the "-- VISUAL --" mode message sometimes doesn't appear. This happens because skip_showmode() calls char_avail(), which reads raw terminal input and picks up terminal response escape sequences (e.g. t_RV response). Combined with !KeyTyped (which is TRUE after script execution), this causes skip_showmode() to return TRUE, preventing the mode from being displayed.
Fix this by checking only the stuff buffer and typeahead buffer for pending characters, instead of char_avail() which also reads raw terminal input. This way, terminal response sequences no longer interfere with mode display.
closes: #16620
https://github.com/vim/vim/pull/19801
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra commented on this pull request.
In src/screen.c:
> if (global_busy || msg_silent != 0 || !redrawing() - || (char_avail() && !KeyTyped)) + || ((!stuff_empty() || typebuf.tb_len > 0) && !KeyTyped))
Hm, should it be:
⬇️ Suggested change- || ((!stuff_empty() || typebuf.tb_len > 0) && !KeyTyped)) + || ((!stuff_empty() || typebuf.tb_len > 0 || using_script()) && !KeyTyped))
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@h-east commented on this pull request.
In src/screen.c:
> if (global_busy || msg_silent != 0 || !redrawing() - || (char_avail() && !KeyTyped)) + || ((!stuff_empty() || typebuf.tb_len > 0) && !KeyTyped))
Right. Thanks.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@h-east pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@h-east pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()