summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-16 15:50:45 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-16 15:50:45 +0200
commit8cdbd5b3c4225b04536dea7523718695306b16b5 (patch)
treed7cd76c65d4489a9c76ec848c358f0876cc0c71c
parent1c196e7b1742c1a50ce0d74190721acaad087f81 (diff)
downloadvim-git-8cdbd5b3c4225b04536dea7523718695306b16b5.tar.gz
patch 8.1.1555: NOT_IN_POPUP_WINDOW is confusingv8.1.1555
Problem: NOT_IN_POPUP_WINDOW is confusing. (Andy Massimino) Solution: Rename to ERROR_IF_POPUP_WINDOW().
-rw-r--r--src/ex_cmds2.c2
-rw-r--r--src/ex_docmd.c10
-rw-r--r--src/macros.h5
-rw-r--r--src/popupwin.c2
-rw-r--r--src/proto/popupwin.pro2
-rw-r--r--src/version.c2
-rw-r--r--src/window.c10
7 files changed, 18 insertions, 15 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 3c73030e6..af7aa4b8e 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1864,7 +1864,7 @@ do_argfile(exarg_T *eap, int argn)
char_u *p;
int old_arg_idx = curwin->w_arg_idx;
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
if (argn < 0 || argn >= ARGCOUNT)
{
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 438cb355a..d2a6681c6 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5454,7 +5454,7 @@ ex_doautocmd(exarg_T *eap)
static void
ex_bunload(exarg_T *eap)
{
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
eap->errmsg = do_bufdel(
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
@@ -5470,7 +5470,7 @@ ex_bunload(exarg_T *eap)
static void
ex_buffer(exarg_T *eap)
{
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
if (*eap->arg)
eap->errmsg = e_trailing;
@@ -6774,7 +6774,7 @@ ex_splitview(exarg_T *eap)
|| eap->cmdidx == CMD_tabfind
|| eap->cmdidx == CMD_tabnew;
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
#ifdef FEAT_GUI
@@ -6904,7 +6904,7 @@ ex_tabnext(exarg_T *eap)
{
int tab_number;
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
switch (eap->cmdidx)
{
@@ -7157,7 +7157,7 @@ do_exedit(
int need_hide;
int exmode_was = exmode_active;
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
/*
* ":vi" command ends Ex mode.
diff --git a/src/macros.h b/src/macros.h
index 0f5ab7739..d685deafb 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -340,8 +340,9 @@
/* Wether a command index indicates a user command. */
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
+// Give an error in curwin is a popup window and evaluate to TRUE.
#ifdef FEAT_TEXT_PROP
-# define NOT_IN_POPUP_WINDOW not_in_popup_window()
+# define ERROR_IF_POPUP_WINDOW error_if_popup_window()
#else
-# define NOT_IN_POPUP_WINDOW 0
+# define ERROR_IF_POPUP_WINDOW 0
#endif
diff --git a/src/popupwin.c b/src/popupwin.c
index 99ef2908c..ea1a1e1e7 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1336,7 +1336,7 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
}
int
-not_in_popup_window()
+error_if_popup_window()
{
if (bt_popup(curwin->w_buffer))
{
diff --git a/src/proto/popupwin.pro b/src/proto/popupwin.pro
index e026506c5..1eb2c102a 100644
--- a/src/proto/popupwin.pro
+++ b/src/proto/popupwin.pro
@@ -21,7 +21,7 @@ void close_all_popups(void);
void f_popup_move(typval_T *argvars, typval_T *rettv);
void f_popup_getpos(typval_T *argvars, typval_T *rettv);
void f_popup_getoptions(typval_T *argvars, typval_T *rettv);
-int not_in_popup_window(void);
+int error_if_popup_window(void);
void popup_reset_handled(void);
win_T *find_next_popup(int lowest);
int popup_do_filter(int c);
diff --git a/src/version.c b/src/version.c
index fcdf562d4..bf1a1f204 100644
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1555,
+/**/
1554,
/**/
1553,
diff --git a/src/window.c b/src/window.c
index 436912934..ee616ee96 100644
--- a/src/window.c
+++ b/src/window.c
@@ -87,7 +87,7 @@ do_window(
#endif
char_u cbuf[40];
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
#ifdef FEAT_CMDWIN
@@ -735,7 +735,7 @@ cmd_with_count(
int
win_split(int size, int flags)
{
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return FAIL;
/* When the ":tab" modifier was used open a new tab page instead. */
@@ -1523,7 +1523,7 @@ win_exchange(long Prenum)
win_T *wp2;
int temp;
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
if (ONE_WINDOW) // just one window
{
@@ -2379,7 +2379,7 @@ win_close(win_T *win, int free_buf)
tabpage_T *prev_curtab = curtab;
frame_T *win_frame = win->w_frame->fr_parent;
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return FAIL;
if (last_window())
@@ -4240,7 +4240,7 @@ win_goto(win_T *wp)
win_T *owp = curwin;
#endif
- if (NOT_IN_POPUP_WINDOW)
+ if (ERROR_IF_POPUP_WINDOW)
return;
if (text_locked())
{