Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash when cmdheight=0 and :intro is executed #26505

Closed
omar25h opened this issue Dec 10, 2023 · 5 comments · Fixed by #28343
Closed

crash when cmdheight=0 and :intro is executed #26505

omar25h opened this issue Dec 10, 2023 · 5 comments · Fixed by #28343
Labels
bug-crash issue reporting a crash or segfault bug-regression wrong behavior that was introduced in a previous commit (please bisect) has:bisected issue has been tracked to a specific commit messages UI messages, log messages ui
Milestone

Comments

@omar25h
Copy link
Contributor

omar25h commented Dec 10, 2023

Problem

Neovim crashes when cmdheight=0 and the :intro command is executed. This does not happen when cmdheight is set to any positive number

Assertion failed: (to_scroll >= 0), function msg_scroll_flush, file message.c, line 2345.

Steps to reproduce

nvim --clean
:set cmdheight=0
:intro

Expected behavior

Intro is shown and nvim does not crash

Neovim version (nvim -v)

NVIM v0.10.0-dev-1801+g2ebd328a7

Vim (not Nvim) behaves the same?

no

Operating system/version

macOS 14.1.2

Terminal name/version

Wezterm

$TERM environment variable

wezterm

Installation

bob

@omar25h omar25h added the bug issues reporting wrong behavior label Dec 10, 2023
@glepnir glepnir added ui bug-crash issue reporting a crash or segfault labels Dec 10, 2023
@clason

This comment was marked as off-topic.

@glepnir
Copy link
Member

glepnir commented Dec 10, 2023

I can reproduce. not sure this is correct.

-    assert(to_scroll >= 0);
+    if (p_ch > 0) {
+      assert(to_scroll >= 0);
+    }

@zeertzjq
Copy link
Member

Bisected to 3a7cb72

@zeertzjq zeertzjq added bug-regression wrong behavior that was introduced in a previous commit (please bisect) has:bisected issue has been tracked to a specific commit and removed bug issues reporting wrong behavior labels Dec 10, 2023
@zeertzjq
Copy link
Member

This seems to fix the problem:

diff --git a/src/nvim/version.c b/src/nvim/version.c
index 2caf2c0cb..470e0b421 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -2831,6 +2831,11 @@ void intro_message(int colon)
       }
     }
   }
+
+  // Make the wait-return message appear just below the text.
+  if (colon) {
+    msg_row = row;
+  }
 }
 
 static void do_intro_line(int row, char *mesg, int attr)

@zeertzjq
Copy link
Member

Fixed by #28343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-crash issue reporting a crash or segfault bug-regression wrong behavior that was introduced in a previous commit (please bisect) has:bisected issue has been tracked to a specific commit messages UI messages, log messages ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants