0
0
mirror of https://github.com/vim/vim.git synced 2025-09-10 22:33:40 -04:00

updated for version 7.4.450

Problem:    Not all commands that edit another buffer support the +cmd
            argument.
Solution:   Add the +cmd argument to relevant commands. (Marcin Szamotulski)
This commit is contained in:
Bram Moolenaar 2014-09-19 20:07:26 +02:00
parent 5bfa2ed6e4
commit 9c8d9e1952
4 changed files with 66 additions and 41 deletions

View File

@ -1042,36 +1042,41 @@ list of buffers. |unlisted-buffer|
a number). Insert a backslash before a space in a buffer a number). Insert a backslash before a space in a buffer
name. name.
:[N]b[uffer][!] [N] *:b* *:bu* *:buf* *:buffer* *E86* :[N]b[uffer][!] [+cmd] [N] *:b* *:bu* *:buf* *:buffer* *E86*
Edit buffer [N] from the buffer list. If [N] is not given, Edit buffer [N] from the buffer list. If [N] is not given,
the current buffer remains being edited. See |:buffer-!| for the current buffer remains being edited. See |:buffer-!| for
[!]. This will also edit a buffer that is not in the buffer [!]. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag. list, without setting the 'buflisted' flag.
Also see ||+cmd|.
:[N]b[uffer][!] {bufname} :[N]b[uffer][!] [+cmd] {bufname}
Edit buffer for {bufname} from the buffer list. See Edit buffer for {bufname} from the buffer list. See
|:buffer-!| for [!]. This will also edit a buffer that is not |:buffer-!| for [!]. This will also edit a buffer that is not
in the buffer list, without setting the 'buflisted' flag. in the buffer list, without setting the 'buflisted' flag.
Also see ||+cmd|.
:[N]sb[uffer] [N] *:sb* *:sbuffer* :[N]sb[uffer] [+cmd] [N] *:sb* *:sbuffer*
Split window and edit buffer [N] from the buffer list. If [N] Split window and edit buffer [N] from the buffer list. If [N]
is not given, the current buffer is edited. Respects the is not given, the current buffer is edited. Respects the
"useopen" setting of 'switchbuf' when splitting. This will "useopen" setting of 'switchbuf' when splitting. This will
also edit a buffer that is not in the buffer list, without also edit a buffer that is not in the buffer list, without
setting the 'buflisted' flag. setting the 'buflisted' flag.
Also see ||+cmd|.
:[N]sb[uffer] {bufname} :[N]sb[uffer] [+cmd] {bufname}
Split window and edit buffer for {bufname} from the buffer Split window and edit buffer for {bufname} from the buffer
list. This will also edit a buffer that is not in the buffer list. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag. list, without setting the 'buflisted' flag.
Note: If what you want to do is split the buffer, make a copy Note: If what you want to do is split the buffer, make a copy
under another name, you can do it this way: > under another name, you can do it this way: >
:w foobar | sp # :w foobar | sp #
< Also see ||+cmd|.
:[N]bn[ext][!] [N] *:bn* *:bnext* *E87* :[N]bn[ext][!] [+cmd] [N] *:bn* *:bnext* *E87*
Go to [N]th next buffer in buffer list. [N] defaults to one. Go to [N]th next buffer in buffer list. [N] defaults to one.
Wraps around the end of the buffer list. Wraps around the end of the buffer list.
See |:buffer-!| for [!]. See |:buffer-!| for [!].
Also see ||+cmd|.
If you are in a help buffer, this takes you to the next help If you are in a help buffer, this takes you to the next help
buffer (if there is one). Similarly, if you are in a normal buffer (if there is one). Similarly, if you are in a normal
(non-help) buffer, this takes you to the next normal buffer. (non-help) buffer, this takes you to the next normal buffer.
@ -1079,55 +1084,61 @@ list of buffers. |unlisted-buffer|
the way when you're browsing code/text buffers. The next three the way when you're browsing code/text buffers. The next three
commands also work like this. commands also work like this.
*:sbn* *:sbnext* *:sbn* *:sbnext*
:[N]sbn[ext] [N] :[N]sbn[ext] [+cmd] [N]
Split window and go to [N]th next buffer in buffer list. Split window and go to [N]th next buffer in buffer list.
Wraps around the end of the buffer list. Uses 'switchbuf' Wraps around the end of the buffer list. Uses 'switchbuf'
Also see ||+cmd|.
:[N]bN[ext][!] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88* :[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
:[N]bp[revious][!] [N] :[N]bp[revious][!] [+cmd] [N]
Go to [N]th previous buffer in buffer list. [N] defaults to Go to [N]th previous buffer in buffer list. [N] defaults to
one. Wraps around the start of the buffer list. one. Wraps around the start of the buffer list.
See |:buffer-!| for [!] and 'switchbuf'. See |:buffer-!| for [!] and 'switchbuf'.
Also see ||+cmd|.
:[N]sbN[ext] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious* :[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
:[N]sbp[revious] [N] :[N]sbp[revious] [+cmd] [N]
Split window and go to [N]th previous buffer in buffer list. Split window and go to [N]th previous buffer in buffer list.
Wraps around the start of the buffer list. Wraps around the start of the buffer list.
Uses 'switchbuf'. Uses 'switchbuf'.
Also see ||+cmd|.
*:br* *:brewind* :br[ewind][!] [+cmd] *:br* *:brewind*
:br[ewind][!] Go to first buffer in buffer list. If the buffer list is Go to first buffer in buffer list. If the buffer list is
empty, go to the first unlisted buffer. empty, go to the first unlisted buffer.
See |:buffer-!| for [!]. See |:buffer-!| for [!].
*:bf* *:bfirst* :bf[irst] [+cmd] *:bf* *:bfirst*
:bf[irst] Same as ":brewind". Same as |:brewind|.
Also see |+cmd|.
*:sbr* *:sbrewind* :sbr[ewind] [+cmd] *:sbr* *:sbrewind*
:sbr[ewind] Split window and go to first buffer in buffer list. If the Split window and go to first buffer in buffer list. If the
buffer list is empty, go to the first unlisted buffer. buffer list is empty, go to the first unlisted buffer.
Respects the 'switchbuf' option. Respects the 'switchbuf' option.
Also see |+cmd|.
*:sbf* *:sbfirst* :sbf[irst] [+cmd] *:sbf* *:sbfirst*
:sbf[irst] Same as ":sbrewind". Same as ":sbrewind".
*:bl* *:blast* :bl[ast][!] [+cmd] *:bl* *:blast*
:bl[ast][!] Go to last buffer in buffer list. If the buffer list is Go to last buffer in buffer list. If the buffer list is
empty, go to the last unlisted buffer. empty, go to the last unlisted buffer.
See |:buffer-!| for [!]. See |:buffer-!| for [!].
*:sbl* *:sblast* :sbl[ast] [+cmd] *:sbl* *:sblast*
:sbl[ast] Split window and go to last buffer in buffer list. If the Split window and go to last buffer in buffer list. If the
buffer list is empty, go to the last unlisted buffer. buffer list is empty, go to the last unlisted buffer.
Respects 'switchbuf' option. Respects 'switchbuf' option.
:[N]bm[odified][!] [N] *:bm* *:bmodified* *E84* :[N]bm[odified][!] [+cmd] [N] *:bm* *:bmodified* *E84*
Go to [N]th next modified buffer. Note: this command also Go to [N]th next modified buffer. Note: this command also
finds unlisted buffers. If there is no modified buffer the finds unlisted buffers. If there is no modified buffer the
command fails. command fails.
:[N]sbm[odified] [N] *:sbm* *:sbmodified* :[N]sbm[odified] [+cmd] [N] *:sbm* *:sbmodified*
Split window and go to [N]th next modified buffer. Split window and go to [N]th next modified buffer.
Respects 'switchbuf' option. Respects 'switchbuf' option.
Note: this command also finds buffers not in the buffer list. Note: this command also finds buffers not in the buffer list.

View File

@ -132,9 +132,9 @@ EX(CMD_augroup, "augroup", ex_autocmd,
EX(CMD_aunmenu, "aunmenu", ex_menu, EX(CMD_aunmenu, "aunmenu", ex_menu,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_buffer, "buffer", ex_buffer, EX(CMD_buffer, "buffer", ex_buffer,
BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR), BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
EX(CMD_bNext, "bNext", ex_bprevious, EX(CMD_bNext, "bNext", ex_bprevious,
BANG|RANGE|NOTADR|COUNT|TRLBAR), BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_ball, "ball", ex_buffer_all, EX(CMD_ball, "ball", ex_buffer_all,
RANGE|NOTADR|COUNT|TRLBAR), RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_badd, "badd", ex_edit, EX(CMD_badd, "badd", ex_edit,
@ -146,19 +146,19 @@ EX(CMD_behave, "behave", ex_behave,
EX(CMD_belowright, "belowright", ex_wrongmodifier, EX(CMD_belowright, "belowright", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM), NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_bfirst, "bfirst", ex_brewind, EX(CMD_bfirst, "bfirst", ex_brewind,
BANG|RANGE|NOTADR|TRLBAR), BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
EX(CMD_blast, "blast", ex_blast, EX(CMD_blast, "blast", ex_blast,
BANG|RANGE|NOTADR|TRLBAR), BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
EX(CMD_bmodified, "bmodified", ex_bmodified, EX(CMD_bmodified, "bmodified", ex_bmodified,
BANG|RANGE|NOTADR|COUNT|TRLBAR), BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_bnext, "bnext", ex_bnext, EX(CMD_bnext, "bnext", ex_bnext,
BANG|RANGE|NOTADR|COUNT|TRLBAR), BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_botright, "botright", ex_wrongmodifier, EX(CMD_botright, "botright", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM), NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_bprevious, "bprevious", ex_bprevious, EX(CMD_bprevious, "bprevious", ex_bprevious,
BANG|RANGE|NOTADR|COUNT|TRLBAR), BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_brewind, "brewind", ex_brewind, EX(CMD_brewind, "brewind", ex_brewind,
BANG|RANGE|NOTADR|TRLBAR), BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
EX(CMD_break, "break", ex_break, EX(CMD_break, "break", ex_break,
TRLBAR|SBOXOK|CMDWIN), TRLBAR|SBOXOK|CMDWIN),
EX(CMD_breakadd, "breakadd", ex_breakadd, EX(CMD_breakadd, "breakadd", ex_breakadd,
@ -814,23 +814,23 @@ EX(CMD_sandbox, "sandbox", ex_wrongmodifier,
EX(CMD_saveas, "saveas", ex_write, EX(CMD_saveas, "saveas", ex_write,
BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR), BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
EX(CMD_sbuffer, "sbuffer", ex_buffer, EX(CMD_sbuffer, "sbuffer", ex_buffer,
BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR), BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
EX(CMD_sbNext, "sbNext", ex_bprevious, EX(CMD_sbNext, "sbNext", ex_bprevious,
RANGE|NOTADR|COUNT|TRLBAR), RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sball, "sball", ex_buffer_all, EX(CMD_sball, "sball", ex_buffer_all,
RANGE|NOTADR|COUNT|TRLBAR), RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbfirst, "sbfirst", ex_brewind, EX(CMD_sbfirst, "sbfirst", ex_brewind,
TRLBAR), EDITCMD|TRLBAR),
EX(CMD_sblast, "sblast", ex_blast, EX(CMD_sblast, "sblast", ex_blast,
TRLBAR), EDITCMD|TRLBAR),
EX(CMD_sbmodified, "sbmodified", ex_bmodified, EX(CMD_sbmodified, "sbmodified", ex_bmodified,
RANGE|NOTADR|COUNT|TRLBAR), RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbnext, "sbnext", ex_bnext, EX(CMD_sbnext, "sbnext", ex_bnext,
RANGE|NOTADR|COUNT|TRLBAR), RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbprevious, "sbprevious", ex_bprevious, EX(CMD_sbprevious, "sbprevious", ex_bprevious,
RANGE|NOTADR|COUNT|TRLBAR), RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbrewind, "sbrewind", ex_brewind, EX(CMD_sbrewind, "sbrewind", ex_brewind,
TRLBAR), EDITCMD|TRLBAR),
EX(CMD_scriptnames, "scriptnames", ex_scriptnames, EX(CMD_scriptnames, "scriptnames", ex_scriptnames,
TRLBAR|CMDWIN), TRLBAR|CMDWIN),
EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding, EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,

View File

@ -5135,6 +5135,8 @@ ex_buffer(eap)
goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0); goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0);
else else
goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2); goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
} }
} }
@ -5147,6 +5149,8 @@ ex_bmodified(eap)
exarg_T *eap; exarg_T *eap;
{ {
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2); goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
} }
/* /*
@ -5158,6 +5162,8 @@ ex_bnext(eap)
exarg_T *eap; exarg_T *eap;
{ {
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2); goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
} }
/* /*
@ -5171,6 +5177,8 @@ ex_bprevious(eap)
exarg_T *eap; exarg_T *eap;
{ {
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2); goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
} }
/* /*
@ -5184,6 +5192,8 @@ ex_brewind(eap)
exarg_T *eap; exarg_T *eap;
{ {
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0); goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
} }
/* /*
@ -5195,6 +5205,8 @@ ex_blast(eap)
exarg_T *eap; exarg_T *eap;
{ {
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0); goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
} }
#endif #endif

View File

@ -741,6 +741,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 */
/**/
450,
/**/ /**/
449, 449,
/**/ /**/