Commit 9a2260d
patch 9.2.0238: showmode message may not be displayed
Problem: showmode message may not be displayed (Yee Cheng Chin)
Solution: Don't call char_avail() in skip_showmode(), but check
for anything in the stuff and typeahead buffer
(Hirohito Higashi).
Fix "-- VISUAL --" not shown when terminal responses are pending
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.
fixes: #16620
closes: #19801
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>1 parent 25f6539 commit 9a2260d
2 files changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4417 | 4417 | | |
4418 | 4418 | | |
4419 | 4419 | | |
4420 | | - | |
| 4420 | + | |
4421 | 4421 | | |
4422 | 4422 | | |
4423 | 4423 | | |
4424 | 4424 | | |
4425 | | - | |
4426 | | - | |
| 4425 | + | |
| 4426 | + | |
| 4427 | + | |
| 4428 | + | |
4427 | 4429 | | |
4428 | 4430 | | |
4429 | 4431 | | |
4430 | | - | |
| 4432 | + | |
| 4433 | + | |
4431 | 4434 | | |
4432 | 4435 | | |
4433 | 4436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| 737 | + | |
| 738 | + | |
737 | 739 | | |
738 | 740 | | |
739 | 741 | | |
| |||
0 commit comments