aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-16 10:38:17 +0800
committerGitHub <noreply@github.com>2024-04-16 10:38:17 +0800
commit60fb8a6a8bd94132a5dbf3a4520ba0db7ae5a9e3 (patch)
treec601e1b6f153282785c8e92d1d3bf868fef1b04d /src
parente3c083832c77eb7c24442bd10bbb718599a764d9 (diff)
downloadrneovim-60fb8a6a8bd94132a5dbf3a4520ba0db7ae5a9e3.tar.gz
rneovim-60fb8a6a8bd94132a5dbf3a4520ba0db7ae5a9e3.tar.bz2
rneovim-60fb8a6a8bd94132a5dbf3a4520ba0db7ae5a9e3.zip
fix(messages): avoid crash with :intro and ch=0 (#28343)
This just copies code from msg_start() to wait_return(). Not sure if there is a better place to put such a block.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 362dc2c05a..49db12df42 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1191,6 +1191,14 @@ void wait_return(int redraw)
check_timestamps(false);
}
+ // if cmdheight=0, we need to scroll in the first line of msg_grid upon the screen
+ if (p_ch == 0 && !ui_has(kUIMessages) && !msg_scrolled) {
+ msg_grid_validate();
+ msg_scroll_up(false, true);
+ msg_scrolled++;
+ cmdline_row = Rows - 1;
+ }
+
hit_return_msg(true);
do {