Skip to content

Commit 8cdbd5b

Browse files
committed
patch 8.1.1555: NOT_IN_POPUP_WINDOW is confusing
Problem: NOT_IN_POPUP_WINDOW is confusing. (Andy Massimino) Solution: Rename to ERROR_IF_POPUP_WINDOW().
1 parent 1c196e7 commit 8cdbd5b

7 files changed

Lines changed: 18 additions & 15 deletions

File tree

src/ex_cmds2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ do_argfile(exarg_T *eap, int argn)
18641864
char_u *p;
18651865
int old_arg_idx = curwin->w_arg_idx;
18661866

1867-
if (NOT_IN_POPUP_WINDOW)
1867+
if (ERROR_IF_POPUP_WINDOW)
18681868
return;
18691869
if (argn < 0 || argn >= ARGCOUNT)
18701870
{

src/ex_docmd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5454,7 +5454,7 @@ ex_doautocmd(exarg_T *eap)
54545454
static void
54555455
ex_bunload(exarg_T *eap)
54565456
{
5457-
if (NOT_IN_POPUP_WINDOW)
5457+
if (ERROR_IF_POPUP_WINDOW)
54585458
return;
54595459
eap->errmsg = do_bufdel(
54605460
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
@@ -5470,7 +5470,7 @@ ex_bunload(exarg_T *eap)
54705470
static void
54715471
ex_buffer(exarg_T *eap)
54725472
{
5473-
if (NOT_IN_POPUP_WINDOW)
5473+
if (ERROR_IF_POPUP_WINDOW)
54745474
return;
54755475
if (*eap->arg)
54765476
eap->errmsg = e_trailing;
@@ -6774,7 +6774,7 @@ ex_splitview(exarg_T *eap)
67746774
|| eap->cmdidx == CMD_tabfind
67756775
|| eap->cmdidx == CMD_tabnew;
67766776

6777-
if (NOT_IN_POPUP_WINDOW)
6777+
if (ERROR_IF_POPUP_WINDOW)
67786778
return;
67796779

67806780
#ifdef FEAT_GUI
@@ -6904,7 +6904,7 @@ ex_tabnext(exarg_T *eap)
69046904
{
69056905
int tab_number;
69066906

6907-
if (NOT_IN_POPUP_WINDOW)
6907+
if (ERROR_IF_POPUP_WINDOW)
69086908
return;
69096909
switch (eap->cmdidx)
69106910
{
@@ -7157,7 +7157,7 @@ do_exedit(
71577157
int need_hide;
71587158
int exmode_was = exmode_active;
71597159

7160-
if (NOT_IN_POPUP_WINDOW)
7160+
if (ERROR_IF_POPUP_WINDOW)
71617161
return;
71627162
/*
71637163
* ":vi" command ends Ex mode.

src/macros.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@
340340
/* Wether a command index indicates a user command. */
341341
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
342342

343+
// Give an error in curwin is a popup window and evaluate to TRUE.
343344
#ifdef FEAT_TEXT_PROP
344-
# define NOT_IN_POPUP_WINDOW not_in_popup_window()
345+
# define ERROR_IF_POPUP_WINDOW error_if_popup_window()
345346
#else
346-
# define NOT_IN_POPUP_WINDOW 0
347+
# define ERROR_IF_POPUP_WINDOW 0
347348
#endif

src/popupwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
13361336
}
13371337

13381338
int
1339-
not_in_popup_window()
1339+
error_if_popup_window()
13401340
{
13411341
if (bt_popup(curwin->w_buffer))
13421342
{

src/proto/popupwin.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void close_all_popups(void);
2121
void f_popup_move(typval_T *argvars, typval_T *rettv);
2222
void f_popup_getpos(typval_T *argvars, typval_T *rettv);
2323
void f_popup_getoptions(typval_T *argvars, typval_T *rettv);
24-
int not_in_popup_window(void);
24+
int error_if_popup_window(void);
2525
void popup_reset_handled(void);
2626
win_T *find_next_popup(int lowest);
2727
int popup_do_filter(int c);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1555,
780782
/**/
781783
1554,
782784
/**/

src/window.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ do_window(
8787
#endif
8888
char_u cbuf[40];
8989

90-
if (NOT_IN_POPUP_WINDOW)
90+
if (ERROR_IF_POPUP_WINDOW)
9191
return;
9292

9393
#ifdef FEAT_CMDWIN
@@ -735,7 +735,7 @@ cmd_with_count(
735735
int
736736
win_split(int size, int flags)
737737
{
738-
if (NOT_IN_POPUP_WINDOW)
738+
if (ERROR_IF_POPUP_WINDOW)
739739
return FAIL;
740740

741741
/* When the ":tab" modifier was used open a new tab page instead. */
@@ -1523,7 +1523,7 @@ win_exchange(long Prenum)
15231523
win_T *wp2;
15241524
int temp;
15251525

1526-
if (NOT_IN_POPUP_WINDOW)
1526+
if (ERROR_IF_POPUP_WINDOW)
15271527
return;
15281528
if (ONE_WINDOW) // just one window
15291529
{
@@ -2379,7 +2379,7 @@ win_close(win_T *win, int free_buf)
23792379
tabpage_T *prev_curtab = curtab;
23802380
frame_T *win_frame = win->w_frame->fr_parent;
23812381

2382-
if (NOT_IN_POPUP_WINDOW)
2382+
if (ERROR_IF_POPUP_WINDOW)
23832383
return FAIL;
23842384

23852385
if (last_window())
@@ -4240,7 +4240,7 @@ win_goto(win_T *wp)
42404240
win_T *owp = curwin;
42414241
#endif
42424242

4243-
if (NOT_IN_POPUP_WINDOW)
4243+
if (ERROR_IF_POPUP_WINDOW)
42444244
return;
42454245
if (text_locked())
42464246
{

0 commit comments

Comments
 (0)