Patch 8.1.1555

8 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 16, 2019, 9:51:12 AM6/16/19
to vim...@googlegroups.com

Patch 8.1.1555
Problem: NOT_IN_POPUP_WINDOW is confusing. (Andy Massimino)
Solution: Rename to ERROR_IF_POPUP_WINDOW().
Files: src/popupwin.c, src/proto/popupwin.pro, src/macros.h,
src/ex_cmds2.c, src/ex_docmd.c, src/window.c


*** ../vim-8.1.1554/src/popupwin.c 2019-06-16 15:31:38.737109971 +0200
--- src/popupwin.c 2019-06-16 15:46:16.445631691 +0200
***************
*** 1336,1342 ****
}

int
! not_in_popup_window()
{
if (bt_popup(curwin->w_buffer))
{
--- 1336,1342 ----
}

int
! error_if_popup_window()
{
if (bt_popup(curwin->w_buffer))
{
*** ../vim-8.1.1554/src/proto/popupwin.pro 2019-06-16 15:31:38.737109971 +0200
--- src/proto/popupwin.pro 2019-06-16 15:49:15.676907349 +0200
***************
*** 21,27 ****
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);
void popup_reset_handled(void);
win_T *find_next_popup(int lowest);
int popup_do_filter(int c);
--- 21,27 ----
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 error_if_popup_window(void);
void popup_reset_handled(void);
win_T *find_next_popup(int lowest);
int popup_do_filter(int c);
*** ../vim-8.1.1554/src/macros.h 2019-06-01 14:15:49.535433551 +0200
--- src/macros.h 2019-06-16 15:47:44.925274381 +0200
***************
*** 340,347 ****
/* Wether a command index indicates a user command. */
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)

#ifdef FEAT_TEXT_PROP
! # define NOT_IN_POPUP_WINDOW not_in_popup_window()
#else
! # define NOT_IN_POPUP_WINDOW 0
#endif
--- 340,348 ----
/* 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 ERROR_IF_POPUP_WINDOW error_if_popup_window()
#else
! # define ERROR_IF_POPUP_WINDOW 0
#endif
*** ../vim-8.1.1554/src/ex_cmds2.c 2019-06-08 18:07:17.748161711 +0200
--- src/ex_cmds2.c 2019-06-16 15:46:42.857525099 +0200
***************
*** 1864,1870 ****
char_u *p;
int old_arg_idx = curwin->w_arg_idx;

! if (NOT_IN_POPUP_WINDOW)
return;
if (argn < 0 || argn >= ARGCOUNT)
{
--- 1864,1870 ----
char_u *p;
int old_arg_idx = curwin->w_arg_idx;

! if (ERROR_IF_POPUP_WINDOW)
return;
if (argn < 0 || argn >= ARGCOUNT)
{
*** ../vim-8.1.1554/src/ex_docmd.c 2019-06-15 19:37:11.680608505 +0200
--- src/ex_docmd.c 2019-06-16 15:49:25.052869387 +0200
***************
*** 5454,5460 ****
static void
ex_bunload(exarg_T *eap)
{
! if (NOT_IN_POPUP_WINDOW)
return;
eap->errmsg = do_bufdel(
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
--- 5454,5460 ----
static void
ex_bunload(exarg_T *eap)
{
! if (ERROR_IF_POPUP_WINDOW)
return;
eap->errmsg = do_bufdel(
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
***************
*** 5470,5476 ****
static void
ex_buffer(exarg_T *eap)
{
! if (NOT_IN_POPUP_WINDOW)
return;
if (*eap->arg)
eap->errmsg = e_trailing;
--- 5470,5476 ----
static void
ex_buffer(exarg_T *eap)
{
! if (ERROR_IF_POPUP_WINDOW)
return;
if (*eap->arg)
eap->errmsg = e_trailing;
***************
*** 6774,6780 ****
|| eap->cmdidx == CMD_tabfind
|| eap->cmdidx == CMD_tabnew;

! if (NOT_IN_POPUP_WINDOW)
return;

#ifdef FEAT_GUI
--- 6774,6780 ----
|| eap->cmdidx == CMD_tabfind
|| eap->cmdidx == CMD_tabnew;

! if (ERROR_IF_POPUP_WINDOW)
return;

#ifdef FEAT_GUI
***************
*** 6904,6910 ****
{
int tab_number;

! if (NOT_IN_POPUP_WINDOW)
return;
switch (eap->cmdidx)
{
--- 6904,6910 ----
{
int tab_number;

! if (ERROR_IF_POPUP_WINDOW)
return;
switch (eap->cmdidx)
{
***************
*** 7157,7163 ****
int need_hide;
int exmode_was = exmode_active;

! if (NOT_IN_POPUP_WINDOW)
return;
/*
* ":vi" command ends Ex mode.
--- 7157,7163 ----
int need_hide;
int exmode_was = exmode_active;

! if (ERROR_IF_POPUP_WINDOW)
return;
/*
* ":vi" command ends Ex mode.
*** ../vim-8.1.1554/src/window.c 2019-06-13 23:59:46.788290732 +0200
--- src/window.c 2019-06-16 15:47:03.509441710 +0200
***************
*** 87,93 ****
#endif
char_u cbuf[40];

! if (NOT_IN_POPUP_WINDOW)
return;

#ifdef FEAT_CMDWIN
--- 87,93 ----
#endif
char_u cbuf[40];

! if (ERROR_IF_POPUP_WINDOW)
return;

#ifdef FEAT_CMDWIN
***************
*** 735,741 ****
int
win_split(int size, int flags)
{
! if (NOT_IN_POPUP_WINDOW)
return FAIL;

/* When the ":tab" modifier was used open a new tab page instead. */
--- 735,741 ----
int
win_split(int size, int flags)
{
! if (ERROR_IF_POPUP_WINDOW)
return FAIL;

/* When the ":tab" modifier was used open a new tab page instead. */
***************
*** 1523,1529 ****
win_T *wp2;
int temp;

! if (NOT_IN_POPUP_WINDOW)
return;
if (ONE_WINDOW) // just one window
{
--- 1523,1529 ----
win_T *wp2;
int temp;

! if (ERROR_IF_POPUP_WINDOW)
return;
if (ONE_WINDOW) // just one window
{
***************
*** 2379,2385 ****
tabpage_T *prev_curtab = curtab;
frame_T *win_frame = win->w_frame->fr_parent;

! if (NOT_IN_POPUP_WINDOW)
return FAIL;

if (last_window())
--- 2379,2385 ----
tabpage_T *prev_curtab = curtab;
frame_T *win_frame = win->w_frame->fr_parent;

! if (ERROR_IF_POPUP_WINDOW)
return FAIL;

if (last_window())
***************
*** 4240,4246 ****
win_T *owp = curwin;
#endif

! if (NOT_IN_POPUP_WINDOW)
return;
if (text_locked())
{
--- 4240,4246 ----
win_T *owp = curwin;
#endif

! if (ERROR_IF_POPUP_WINDOW)
return;
if (text_locked())
{
*** ../vim-8.1.1554/src/version.c 2019-06-16 15:41:54.730684164 +0200
--- src/version.c 2019-06-16 15:50:29.228609478 +0200
***************
*** 779,780 ****
--- 779,782 ----
{ /* Add new patch number below this line */
+ /**/
+ 1555,
/**/

--
hundred-and-one symptoms of being an internet addict:
204. You're being audited because you mailed your tax return to the IRC.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages