0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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().
This commit is contained in:
Bram Moolenaar
2019-06-16 15:50:45 +02:00
parent 1c196e7b17
commit 8cdbd5b3c4
7 changed files with 18 additions and 15 deletions

View File

@@ -1864,7 +1864,7 @@ do_argfile(exarg_T *eap, int argn)
char_u *p; char_u *p;
int old_arg_idx = curwin->w_arg_idx; int old_arg_idx = curwin->w_arg_idx;
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
if (argn < 0 || argn >= ARGCOUNT) if (argn < 0 || argn >= ARGCOUNT)
{ {

View File

@@ -5454,7 +5454,7 @@ ex_doautocmd(exarg_T *eap)
static void static void
ex_bunload(exarg_T *eap) ex_bunload(exarg_T *eap)
{ {
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
eap->errmsg = do_bufdel( eap->errmsg = do_bufdel(
eap->cmdidx == CMD_bdelete ? DOBUF_DEL eap->cmdidx == CMD_bdelete ? DOBUF_DEL
@@ -5470,7 +5470,7 @@ ex_bunload(exarg_T *eap)
static void static void
ex_buffer(exarg_T *eap) ex_buffer(exarg_T *eap)
{ {
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
if (*eap->arg) if (*eap->arg)
eap->errmsg = e_trailing; eap->errmsg = e_trailing;
@@ -6774,7 +6774,7 @@ ex_splitview(exarg_T *eap)
|| eap->cmdidx == CMD_tabfind || eap->cmdidx == CMD_tabfind
|| eap->cmdidx == CMD_tabnew; || eap->cmdidx == CMD_tabnew;
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
#ifdef FEAT_GUI #ifdef FEAT_GUI
@@ -6904,7 +6904,7 @@ ex_tabnext(exarg_T *eap)
{ {
int tab_number; int tab_number;
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
switch (eap->cmdidx) switch (eap->cmdidx)
{ {
@@ -7157,7 +7157,7 @@ do_exedit(
int need_hide; int need_hide;
int exmode_was = exmode_active; int exmode_was = exmode_active;
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
/* /*
* ":vi" command ends Ex mode. * ":vi" command ends Ex mode.

View File

@@ -340,8 +340,9 @@
/* Wether a command index indicates a user command. */ /* Wether a command index indicates a user command. */
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0) #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 #ifdef FEAT_TEXT_PROP
# define NOT_IN_POPUP_WINDOW not_in_popup_window() # define ERROR_IF_POPUP_WINDOW error_if_popup_window()
#else #else
# define NOT_IN_POPUP_WINDOW 0 # define ERROR_IF_POPUP_WINDOW 0
#endif #endif

View File

@@ -1336,7 +1336,7 @@ f_popup_getoptions(typval_T *argvars, typval_T *rettv)
} }
int int
not_in_popup_window() error_if_popup_window()
{ {
if (bt_popup(curwin->w_buffer)) if (bt_popup(curwin->w_buffer))
{ {

View File

@@ -21,7 +21,7 @@ void close_all_popups(void);
void f_popup_move(typval_T *argvars, typval_T *rettv); void f_popup_move(typval_T *argvars, typval_T *rettv);
void f_popup_getpos(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); 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); void popup_reset_handled(void);
win_T *find_next_popup(int lowest); win_T *find_next_popup(int lowest);
int popup_do_filter(int c); int popup_do_filter(int c);

View File

@@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1555,
/**/ /**/
1554, 1554,
/**/ /**/

View File

@@ -87,7 +87,7 @@ do_window(
#endif #endif
char_u cbuf[40]; char_u cbuf[40];
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
@@ -735,7 +735,7 @@ cmd_with_count(
int int
win_split(int size, int flags) win_split(int size, int flags)
{ {
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return FAIL; return FAIL;
/* When the ":tab" modifier was used open a new tab page instead. */ /* When the ":tab" modifier was used open a new tab page instead. */
@@ -1523,7 +1523,7 @@ win_exchange(long Prenum)
win_T *wp2; win_T *wp2;
int temp; int temp;
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
if (ONE_WINDOW) // just one window if (ONE_WINDOW) // just one window
{ {
@@ -2379,7 +2379,7 @@ win_close(win_T *win, int free_buf)
tabpage_T *prev_curtab = curtab; tabpage_T *prev_curtab = curtab;
frame_T *win_frame = win->w_frame->fr_parent; frame_T *win_frame = win->w_frame->fr_parent;
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return FAIL; return FAIL;
if (last_window()) if (last_window())
@@ -4240,7 +4240,7 @@ win_goto(win_T *wp)
win_T *owp = curwin; win_T *owp = curwin;
#endif #endif
if (NOT_IN_POPUP_WINDOW) if (ERROR_IF_POPUP_WINDOW)
return; return;
if (text_locked()) if (text_locked())
{ {