aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-06-09 16:12:04 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-06-09 16:12:51 -0400
commitaecbbb0b11168a10e5e11e530ef0b10e3aed8a4f (patch)
treeb7a43bbf31639086faeac77f01e0966afa0747b0
parent1ce28d7d9b2fd0e6a81174769e30dc59ded93876 (diff)
downloadrneovim-aecbbb0b11168a10e5e11e530ef0b10e3aed8a4f.tar.gz
rneovim-aecbbb0b11168a10e5e11e530ef0b10e3aed8a4f.tar.bz2
rneovim-aecbbb0b11168a10e5e11e530ef0b10e3aed8a4f.zip
vim-patch:8.1.1509: cmdline_row can become negative, causing a crash
Problem: Cmdline_row can become negative, causing a crash. Solution: Make sure cmdline_row does not become negagive. (closes vim/vim#4102) https://github.com/vim/vim/commit/954bb0636390751c0665d7d730a13d86dc5bc6e6
-rw-r--r--src/nvim/misc1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index c8d85328d2..6da2a8f786 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -2508,9 +2508,10 @@ int prompt_for_number(int *mouse_used)
i = get_number(TRUE, mouse_used);
if (KeyTyped) {
- /* don't call wait_return() now */
- /* msg_putchar('\n'); */
- cmdline_row = msg_row - 1;
+ // don't call wait_return() now
+ if (msg_row > 0) {
+ cmdline_row = msg_row - 1;
+ }
need_wait_return = FALSE;
msg_didany = FALSE;
msg_didout = FALSE;