vim-patch: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)

https://code.google.com/p/vim/source/detail?r=v7-4-450
This commit is contained in:
Florian Walch
2014-12-23 11:51:13 +01:00
parent 4f6bb8a9a9
commit a1c03c33b3
4 changed files with 76 additions and 46 deletions

View File

@@ -127,12 +127,12 @@ return {
},
{
command='buffer',
flags=bit.bor(BANG, RANGE, NOTADR, BUFNAME, BUFUNL, COUNT, EXTRA, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, BUFNAME, BUFUNL, COUNT, EXTRA, EDITCMD, TRLBAR),
func='ex_buffer',
},
{
command='bNext',
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bprevious',
},
{
@@ -162,22 +162,22 @@ return {
},
{
command='bfirst',
flags=bit.bor(BANG, RANGE, NOTADR, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, EDITCMD, TRLBAR),
func='ex_brewind',
},
{
command='blast',
flags=bit.bor(BANG, RANGE, NOTADR, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, EDITCMD, TRLBAR),
func='ex_blast',
},
{
command='bmodified',
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bmodified',
},
{
command='bnext',
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bnext',
},
{
@@ -187,12 +187,12 @@ return {
},
{
command='bprevious',
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bprevious',
},
{
command='brewind',
flags=bit.bor(BANG, RANGE, NOTADR, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, EDITCMD, TRLBAR),
func='ex_brewind',
},
{
@@ -1762,47 +1762,47 @@ return {
},
{
command='sbuffer',
flags=bit.bor(BANG, RANGE, NOTADR, BUFNAME, BUFUNL, COUNT, EXTRA, TRLBAR),
flags=bit.bor(BANG, RANGE, NOTADR, BUFNAME, BUFUNL, COUNT, EXTRA, EDITCMD, TRLBAR),
func='ex_buffer',
},
{
command='sbNext',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bprevious',
},
{
command='sball',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_buffer_all',
},
{
command='sbfirst',
flags=bit.bor(TRLBAR),
flags=bit.bor(EDITCMD, TRLBAR),
func='ex_brewind',
},
{
command='sblast',
flags=bit.bor(TRLBAR),
flags=bit.bor(EDITCMD, TRLBAR),
func='ex_blast',
},
{
command='sbmodified',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bmodified',
},
{
command='sbnext',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bnext',
},
{
command='sbprevious',
flags=bit.bor(RANGE, NOTADR, COUNT, TRLBAR),
flags=bit.bor(RANGE, NOTADR, COUNT, EDITCMD, TRLBAR),
func='ex_bprevious',
},
{
command='sbrewind',
flags=bit.bor(TRLBAR),
flags=bit.bor(EDITCMD, TRLBAR),
func='ex_brewind',
},
{

View File

@@ -3957,13 +3957,17 @@ static void ex_bunload(exarg_T *eap)
*/
static void ex_buffer(exarg_T *eap)
{
if (*eap->arg)
if (*eap->arg) {
eap->errmsg = e_trailing;
else {
if (eap->addr_count == 0) /* default is current buffer */
} else {
if (eap->addr_count == 0) { // default is current buffer
goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0);
else
} else {
goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
}
if (eap->do_ecmd_cmd != NULL) {
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
}
@@ -3974,6 +3978,9 @@ static void ex_buffer(exarg_T *eap)
static void ex_bmodified(exarg_T *eap)
{
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL) {
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
/*
@@ -3983,6 +3990,9 @@ static void ex_bmodified(exarg_T *eap)
static void ex_bnext(exarg_T *eap)
{
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL) {
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
/*
@@ -3994,6 +4004,9 @@ static void ex_bnext(exarg_T *eap)
static void ex_bprevious(exarg_T *eap)
{
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL) {
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
/*
@@ -4005,6 +4018,9 @@ static void ex_bprevious(exarg_T *eap)
static void ex_brewind(exarg_T *eap)
{
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
if (eap->do_ecmd_cmd != NULL) {
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
/*
@@ -4014,6 +4030,9 @@ static void ex_brewind(exarg_T *eap)
static void ex_blast(exarg_T *eap)
{
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
if (eap->do_ecmd_cmd != NULL) {
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
int ends_excmd(int c) FUNC_ATTR_CONST

View File

@@ -287,7 +287,7 @@ static int included_patches[] = {
//453 NA
452,
//451,
//450,
450,
449,
//448 NA
447,