mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.0127: some buffer commands work in a popup window
Problem: Some buffer commands work in a popup window. Solution: Disallow :bnext, :bprev, etc. (Naruhiko Nishino, closes #5494)
This commit is contained in:
@@ -4613,6 +4613,9 @@ ex_bmodified(exarg_T *eap)
|
||||
static void
|
||||
ex_bnext(exarg_T *eap)
|
||||
{
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
|
||||
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
@@ -4627,6 +4630,9 @@ ex_bnext(exarg_T *eap)
|
||||
static void
|
||||
ex_bprevious(exarg_T *eap)
|
||||
{
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
|
||||
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
@@ -4641,6 +4647,9 @@ ex_bprevious(exarg_T *eap)
|
||||
static void
|
||||
ex_brewind(exarg_T *eap)
|
||||
{
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
|
||||
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
@@ -4653,6 +4662,9 @@ ex_brewind(exarg_T *eap)
|
||||
static void
|
||||
ex_blast(exarg_T *eap)
|
||||
{
|
||||
if (ERROR_IF_POPUP_WINDOW)
|
||||
return;
|
||||
|
||||
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
|
@@ -913,6 +913,10 @@ func Test_win_execute_not_allowed()
|
||||
call assert_fails('call win_execute(winid, "next")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "rewind")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "buf")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "bnext")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "bprev")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "bfirst")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "blast")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "edit")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "enew")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "wincmd x")', 'E994:')
|
||||
|
@@ -742,6 +742,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
127,
|
||||
/**/
|
||||
126,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user