Merge #9291 'vim-patch:8.1.{550,551}'

This commit is contained in:
Justin M. Keyes
2018-12-02 23:10:26 +01:00
committed by GitHub
6 changed files with 120 additions and 120 deletions

View File

@@ -19538,6 +19538,7 @@ void ex_echo(exarg_T *eap)
typval_T rettv; typval_T rettv;
bool needclr = true; bool needclr = true;
bool atstart = true; bool atstart = true;
const int did_emsg_before = did_emsg;
if (eap->skip) if (eap->skip)
++emsg_skip; ++emsg_skip;
@@ -19552,7 +19553,7 @@ void ex_echo(exarg_T *eap)
// Report the invalid expression unless the expression evaluation // Report the invalid expression unless the expression evaluation
// has been cancelled due to an aborting error, an interrupt, or an // has been cancelled due to an aborting error, an interrupt, or an
// exception. // exception.
if (!aborting()) { if (!aborting() && did_emsg == did_emsg_before) {
EMSG2(_(e_invexpr2), p); EMSG2(_(e_invexpr2), p);
} }
need_clr_eos = false; need_clr_eos = false;
@@ -19641,7 +19642,7 @@ void ex_execute(exarg_T *eap)
int ret = OK; int ret = OK;
char_u *p; char_u *p;
garray_T ga; garray_T ga;
int save_did_emsg; int save_did_emsg = did_emsg;
ga_init(&ga, 1, 80); ga_init(&ga, 1, 80);
@@ -19655,8 +19656,9 @@ void ex_execute(exarg_T *eap)
* has been cancelled due to an aborting error, an interrupt, or an * has been cancelled due to an aborting error, an interrupt, or an
* exception. * exception.
*/ */
if (!aborting()) if (!aborting() && did_emsg == save_did_emsg) {
EMSG2(_(e_invexpr2), p); EMSG2(_(e_invexpr2), p);
}
ret = FAIL; ret = FAIL;
break; break;
} }

View File

@@ -505,7 +505,7 @@ int emsg(const char_u *s_)
*/ */
if (cause_errthrow((char_u *)s, severe, &ignore) == true) { if (cause_errthrow((char_u *)s, severe, &ignore) == true) {
if (!ignore) { if (!ignore) {
did_emsg = true; did_emsg++;
} }
return true; return true;
} }
@@ -554,7 +554,7 @@ int emsg(const char_u *s_)
} else { } else {
flush_buffers(FLUSH_MINIMAL); // flush internal buffers flush_buffers(FLUSH_MINIMAL); // flush internal buffers
} }
did_emsg = true; // flag for DoOneCmd() did_emsg++; // flag for DoOneCmd()
} }
emsg_on_display = true; // remember there is an error message emsg_on_display = true; // remember there is an error message

View File

@@ -7,7 +7,7 @@ describe(':debug', function()
local screen local screen
before_each(function() before_each(function()
clear() clear()
screen = Screen.new(50, 14) screen = Screen.new(30, 14)
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Blue1}, [1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {bold = true, reverse = true}, [2] = {bold = true, reverse = true},
@@ -28,11 +28,11 @@ describe(':debug', function()
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }|
{2: }| {2: }|
{3:E121: Undefined variable: bork}| {3:E121: Undefined variable: bork}|
{3:E15: Invalid expression: bork} | |
{4:Press ENTER or type command to continue}^ | {4:Press ENTER or type command to}|
{4: continue}^ |
]]) ]])
feed(':debug echo "aa"| echo "bb"<cr>') feed(':debug echo "aa"| echo "bb"<cr>')
@@ -43,12 +43,12 @@ describe(':debug', function()
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }|
{1:~ }|
{2: }| {2: }|
{3:E121: Undefined variable: bork}| {3:E121: Undefined variable: bork}|
{3:E15: Invalid expression: bork} | |
Entering Debug mode. Type "cont" to continue. | {4:Press ENTER or type command to}|
Entering Debug mode. Type "co|
nt" to continue. |
cmd: echo "aa"| echo "bb" | cmd: echo "aa"| echo "bb" |
>^ | >^ |
]]) ]])
@@ -58,12 +58,12 @@ describe(':debug', function()
| |
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }|
{1:~ }|
{2: }| {2: }|
{3:E121: Undefined variable: bork}| {3:E121: Undefined variable: bork}|
{3:E15: Invalid expression: bork} | |
Entering Debug mode. Type "cont" to continue. | {4:Press ENTER or type command to}|
Entering Debug mode. Type "co|
nt" to continue. |
cmd: echo "aa"| echo "bb" | cmd: echo "aa"| echo "bb" |
>step | >step |
aa | aa |
@@ -73,20 +73,20 @@ describe(':debug', function()
feed('step<cr>') feed('step<cr>')
screen:expect([[ screen:expect([[
|
{1:~ }|
{1:~ }|
{2: }| {2: }|
{3:E121: Undefined variable: bork}| {3:E121: Undefined variable: bork}|
{3:E15: Invalid expression: bork} | |
Entering Debug mode. Type "cont" to continue. | {4:Press ENTER or type command to}|
Entering Debug mode. Type "co|
nt" to continue. |
cmd: echo "aa"| echo "bb" | cmd: echo "aa"| echo "bb" |
>step | >step |
aa | aa |
cmd: echo "bb" | cmd: echo "bb" |
>step | >step |
bb | bb |
{4:Press ENTER or type command to continue}^ | {4:Press ENTER or type command to}|
{4: continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')

View File

@@ -121,7 +121,6 @@ describe('108', function()
Error detected while processing function Foo[2]..Bar[2]..Bazz: Error detected while processing function Foo[2]..Bar[2]..Bazz:
line 3: line 3:
E121: Undefined variable: var3 E121: Undefined variable: var3
E15: Invalid expression: var3
here var3 is defined with "another var": here var3 is defined with "another var":
another var another var
@@ -129,7 +128,6 @@ describe('108', function()
Error detected while processing function Foo[2]..Bar: Error detected while processing function Foo[2]..Bar:
line 3: line 3:
E121: Undefined variable: var2 E121: Undefined variable: var2
E15: Invalid expression: var2
here var2 is defined with 10: here var2 is defined with 10:
10 10

View File

@@ -117,7 +117,7 @@ local function test_cmdline(linegrid)
end) end)
it('but not with scrolled messages', function() it('but not with scrolled messages', function()
screen:try_resize(50,10) screen:try_resize(35,10)
feed(':echoerr doesnotexist<cr>') feed(':echoerr doesnotexist<cr>')
screen:expect{grid=[[ screen:expect{grid=[[
| |
@@ -125,38 +125,38 @@ local function test_cmdline(linegrid)
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }|
{3: }| {3: }|
{4:E121: Undefined variable: doesnotexist} | {4:E121: Undefined variable: doesnotex}|
{4:E15: Invalid expression: doesnotexist} | {4:ist} |
{5:Press ENTER or type command to continue}^ | {5:Press ENTER or type command to cont}|
{5:inue}^ |
]]} ]]}
feed(':echoerr doesnotexist<cr>') feed(':echoerr doesnotexist<cr>')
screen:expect{grid=[[ screen:expect{grid=[[
| |
{1:~ }| {1:~ }|
{1:~ }|
{1:~ }|
{3: }| {3: }|
{4:E121: Undefined variable: doesnotexist} | {4:E121: Undefined variable: doesnotex}|
{4:E15: Invalid expression: doesnotexist} | {4:ist} |
{4:E121: Undefined variable: doesnotexist} | {5:Press ENTER or type command to cont}|
{4:E15: Invalid expression: doesnotexist} | {4:E121: Undefined variable: doesnotex}|
{5:Press ENTER or type command to continue}^ | {4:ist} |
{5:Press ENTER or type command to cont}|
{5:inue}^ |
]]} ]]}
feed(':echoerr doesnotexist<cr>') feed(':echoerr doesnotexist<cr>')
screen:expect{grid=[[ screen:expect{grid=[[
| {4:E121: Undefined variable: doesnotex}|
{1:~ }| {4:ist} |
{3: }| {5:Press ENTER or type command to cont}|
{4:E121: Undefined variable: doesnotexist} | {4:E121: Undefined variable: doesnotex}|
{4:E15: Invalid expression: doesnotexist} | {4:ist} |
{4:E121: Undefined variable: doesnotexist} | {5:Press ENTER or type command to cont}|
{4:E15: Invalid expression: doesnotexist} | {4:E121: Undefined variable: doesnotex}|
{4:E121: Undefined variable: doesnotexist} | {4:ist} |
{4:E15: Invalid expression: doesnotexist} | {5:Press ENTER or type command to cont}|
{5:Press ENTER or type command to continue}^ | {5:inue}^ |
]]} ]]}
feed('<cr>') feed('<cr>')

View File

@@ -28,9 +28,9 @@ local function test_embed(ext_linegrid)
| |
| |
| |
|
Error detected while processing pre-vimrc command line: | Error detected while processing pre-vimrc command line: |
E121: Undefined variable: invalid | E121: Undefined variable: invalid |
E15: Invalid expression: invalid+ |
Press ENTER or type command to continue^ | Press ENTER or type command to continue^ |
]]) ]])