comparison src/popupmnu.c @ 13427:b85526d90aba v8.0.1588

patch 8.0.1588: popup menu hangs after typing CTRL-C commit https://github.com/vim/vim/commit/52f18a112a073c39187cd93f26115d1e2bfd29ce Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 7 22:09:11 2018 +0100 patch 8.0.1588: popup menu hangs after typing CTRL-C Problem: Popup menu hangs after typing CTRL-C. Solution: Make CTRL-C exit the loop. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/2697)
author Christian Brabandt <cb@256bit.org>
date Wed, 07 Mar 2018 22:15:05 +0100
parents c415cdd49ea4
children ddf02a93796f
comparison
equal deleted inserted replaced
13426:c953267b2849 13427:b85526d90aba
1173 pum_redraw(); 1173 pum_redraw();
1174 setcursor_mayforce(TRUE); 1174 setcursor_mayforce(TRUE);
1175 out_flush(); 1175 out_flush();
1176 1176
1177 c = vgetc(); 1177 c = vgetc();
1178 if (c == ESC) 1178 if (c == ESC || c == Ctrl_C)
1179 break; 1179 break;
1180 else if (c == CAR || c == NL) 1180 else if (c == CAR || c == NL)
1181 { 1181 {
1182 /* enter: select current item, if any, and close */ 1182 /* enter: select current item, if any, and close */
1183 pum_execute_menu(menu, mode); 1183 pum_execute_menu(menu, mode);
1209 vungetc(c); 1209 vungetc(c);
1210 break; 1210 break;
1211 } 1211 }
1212 else if (c == K_LEFTDRAG || c == K_RIGHTDRAG || c == K_MOUSEMOVE) 1212 else if (c == K_LEFTDRAG || c == K_RIGHTDRAG || c == K_MOUSEMOVE)
1213 { 1213 {
1214 /* mouse moved: selec item in the mouse row */ 1214 /* mouse moved: select item in the mouse row */
1215 pum_select_mouse_pos(); 1215 pum_select_mouse_pos();
1216 } 1216 }
1217 else if (c == K_LEFTMOUSE || c == K_LEFTMOUSE_NM || c == K_RIGHTRELEASE) 1217 else if (c == K_LEFTMOUSE || c == K_LEFTMOUSE_NM || c == K_RIGHTRELEASE)
1218 { 1218 {
1219 /* left mouse click: select clicked item, if any, and close; 1219 /* left mouse click: select clicked item, if any, and close;