comparison src/window.c @ 16874:da5f5836e90c v8.1.1438

patch 8.1.1438: some commands cause trouble in a popup window commit https://github.com/vim/vim/commit/815b76bff618c07226653e11f29c4d3c5640b63a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 1 14:15:52 2019 +0200 patch 8.1.1438: some commands cause trouble in a popup window Problem: Some commands cause trouble in a popup window. Solution: Add NOT_IN_POPUP_WINDOW.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jun 2019 14:30:06 +0200
parents 2b00163053cd
children 998603a243d7
comparison
equal deleted inserted replaced
16873:1958b437e892 16874:da5f5836e90c
85 int type = FIND_DEFINE; 85 int type = FIND_DEFINE;
86 int len; 86 int len;
87 #endif 87 #endif
88 char_u cbuf[40]; 88 char_u cbuf[40];
89 89
90 Prenum1 = Prenum == 0 ? 1 : Prenum; 90 if (NOT_IN_POPUP_WINDOW)
91 return;
91 92
92 #ifdef FEAT_CMDWIN 93 #ifdef FEAT_CMDWIN
93 # define CHECK_CMDWIN \ 94 # define CHECK_CMDWIN \
94 do { \ 95 do { \
95 if (cmdwin_type != 0) \ 96 if (cmdwin_type != 0) \
99 } \ 100 } \
100 } while (0) 101 } while (0)
101 #else 102 #else
102 # define CHECK_CMDWIN do { /**/ } while (0) 103 # define CHECK_CMDWIN do { /**/ } while (0)
103 #endif 104 #endif
105
106 Prenum1 = Prenum == 0 ? 1 : Prenum;
104 107
105 switch (nchar) 108 switch (nchar)
106 { 109 {
107 /* split current window in two parts, horizontally */ 110 /* split current window in two parts, horizontally */
108 case 'S': 111 case 'S':
730 * return FAIL for failure, OK otherwise 733 * return FAIL for failure, OK otherwise
731 */ 734 */
732 int 735 int
733 win_split(int size, int flags) 736 win_split(int size, int flags)
734 { 737 {
738 if (NOT_IN_POPUP_WINDOW)
739 return FAIL;
740
735 /* When the ":tab" modifier was used open a new tab page instead. */ 741 /* When the ":tab" modifier was used open a new tab page instead. */
736 if (may_open_tabpage() == OK) 742 if (may_open_tabpage() == OK)
737 return OK; 743 return OK;
738 744
739 /* Add flags from ":vertical", ":topleft" and ":botright". */ 745 /* Add flags from ":vertical", ":topleft" and ":botright". */
1507 frame_T *frp2; 1513 frame_T *frp2;
1508 win_T *wp; 1514 win_T *wp;
1509 win_T *wp2; 1515 win_T *wp2;
1510 int temp; 1516 int temp;
1511 1517
1512 if (ONE_WINDOW) /* just one window */ 1518 if (NOT_IN_POPUP_WINDOW)
1519 return;
1520 if (ONE_WINDOW) // just one window
1513 { 1521 {
1514 beep_flush(); 1522 beep_flush();
1515 return; 1523 return;
1516 } 1524 }
1517 1525
2361 int dir; 2369 int dir;
2362 int help_window = FALSE; 2370 int help_window = FALSE;
2363 tabpage_T *prev_curtab = curtab; 2371 tabpage_T *prev_curtab = curtab;
2364 frame_T *win_frame = win->w_frame->fr_parent; 2372 frame_T *win_frame = win->w_frame->fr_parent;
2365 2373
2374 if (NOT_IN_POPUP_WINDOW)
2375 return FAIL;
2376
2366 if (last_window()) 2377 if (last_window())
2367 { 2378 {
2368 emsg(_("E444: Cannot close last window")); 2379 emsg(_("E444: Cannot close last window"));
2369 return FAIL; 2380 return FAIL;
2370 } 2381 }
4219 { 4230 {
4220 #ifdef FEAT_CONCEAL 4231 #ifdef FEAT_CONCEAL
4221 win_T *owp = curwin; 4232 win_T *owp = curwin;
4222 #endif 4233 #endif
4223 4234
4235 if (NOT_IN_POPUP_WINDOW)
4236 return;
4224 if (text_locked()) 4237 if (text_locked())
4225 { 4238 {
4226 beep_flush(); 4239 beep_flush();
4227 text_locked_msg(); 4240 text_locked_msg();
4228 return; 4241 return;