comparison src/popupmnu.c @ 16845:d4c50bca8dbc v8.1.1424

patch 8.1.1424: crash when popup menu is deleted while waiting for char commit https://github.com/vim/vim/commit/5c3fb04623d0260762f1c3c1ba250a407098ff2a Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 30 15:53:29 2019 +0200 patch 8.1.1424: crash when popup menu is deleted while waiting for char Problem: Crash when popup menu is deleted while waiting for char. Solution: Bail out when pum_array was cleared.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 May 2019 16:00:07 +0200
parents ce04ebdf26b8
children 03f3a9ca2770
comparison
equal deleted inserted replaced
16844:536acf59c727 16845:d4c50bca8dbc
1300 pum_redraw(); 1300 pum_redraw();
1301 setcursor_mayforce(TRUE); 1301 setcursor_mayforce(TRUE);
1302 out_flush(); 1302 out_flush();
1303 1303
1304 c = vgetc(); 1304 c = vgetc();
1305 if (c == ESC || c == Ctrl_C) 1305
1306 // Bail out when typing Esc, CTRL-C or some callback closed the popup
1307 // menu.
1308 if (c == ESC || c == Ctrl_C || pum_array == NULL)
1306 break; 1309 break;
1307 else if (c == CAR || c == NL) 1310 else if (c == CAR || c == NL)
1308 { 1311 {
1309 /* enter: select current item, if any, and close */ 1312 /* enter: select current item, if any, and close */
1310 pum_execute_menu(menu, mode); 1313 pum_execute_menu(menu, mode);