From 1ce28d7d9b2fd0e6a81174769e30dc59ded93876 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 9 Jun 2019 16:00:09 -0400 Subject: vim-patch:8.0.1756: GUI: after prompting for a number the mouse shape is wrong Problem: GUI: after prompting for a number the mouse shape is sometimes wrong. Solution: Call setmouse() after setting "State". (Hirohito Higashi, closes vim/vim#2709) https://github.com/vim/vim/commit/73658317bacd9a0264dfaa32288de6ea1f236fe5 --- src/nvim/misc1.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 45e03681eb..c8d85328d2 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -2503,6 +2503,8 @@ int prompt_for_number(int *mouse_used) cmdline_row = 0; save_State = State; State = ASKMORE; // prevents a screen update when using a timer + // May show different mouse shape. + setmouse(); i = get_number(TRUE, mouse_used); if (KeyTyped) { @@ -2515,6 +2517,8 @@ int prompt_for_number(int *mouse_used) } else cmdline_row = save_cmdline_row; State = save_State; + // May need to restore mouse shape. + setmouse(); return i; } -- cgit From aecbbb0b11168a10e5e11e530ef0b10e3aed8a4f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 9 Jun 2019 16:12:04 -0400 Subject: 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 --- src/nvim/misc1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit From 84ba37fbcbb420b27c9e3fcd8db79d4857037a82 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 9 Jun 2019 16:25:10 -0400 Subject: lint --- src/nvim/misc1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 6da2a8f786..4e47311dda 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -2512,11 +2512,12 @@ int prompt_for_number(int *mouse_used) if (msg_row > 0) { cmdline_row = msg_row - 1; } - need_wait_return = FALSE; - msg_didany = FALSE; - msg_didout = FALSE; - } else + need_wait_return = false; + msg_didany = false; + msg_didout = false; + } else { cmdline_row = save_cmdline_row; + } State = save_State; // May need to restore mouse shape. setmouse(); -- cgit