mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #9124 'vim-patch:8.0.1672'
This commit is contained in:
commit
aff64b3a52
@ -510,6 +510,10 @@ static int command_line_check(VimState *state)
|
||||
// completion may switch it on.
|
||||
quit_more = false; // reset after CTRL-D which had a more-prompt
|
||||
|
||||
did_emsg = false; // There can't really be a reason why an error
|
||||
// that occurs while typing a command should
|
||||
// cause the command not to be executed.
|
||||
|
||||
cursorcmd(); // set the cursor on the right spot
|
||||
ui_cursor_shape();
|
||||
return 1;
|
||||
|
@ -334,6 +334,17 @@ func Test_paste_in_cmdline()
|
||||
call feedkeys(":\<C-\>etoupper(getline(1))\<CR>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"ASDF.X /TMP/SOME VERYLONGWORD A;B-C*D ', @:)
|
||||
bwipe!
|
||||
|
||||
" Error while typing a command used to cause that it was not executed
|
||||
" in the end.
|
||||
new
|
||||
try
|
||||
call feedkeys(":file \<C-R>%Xtestfile\<CR>", 'tx')
|
||||
catch /^Vim\%((\a\+)\)\=:E32/
|
||||
" ignore error E32
|
||||
endtry
|
||||
call assert_equal("Xtestfile", bufname("%"))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_remove_char_in_cmdline()
|
||||
|
@ -755,7 +755,7 @@ describe('Command-line coloring', function()
|
||||
eq(1, meths.eval('1'))
|
||||
end)
|
||||
end)
|
||||
describe('Ex commands coloring support', function()
|
||||
describe('Ex commands coloring', function()
|
||||
it('works', function()
|
||||
meths.set_var('Nvim_color_cmdline', 'RainBowParens')
|
||||
feed(':echo (((1)))')
|
||||
@ -831,7 +831,7 @@ describe('Ex commands coloring support', function()
|
||||
|
|
||||
]])
|
||||
end)
|
||||
it('does not prevent mapping error from cancelling prompt', function()
|
||||
it('mapping error does not cancel prompt', function()
|
||||
command("cnoremap <expr> x execute('throw 42')[-1]")
|
||||
feed(':#x')
|
||||
screen:expect([[
|
||||
@ -846,16 +846,17 @@ describe('Ex commands coloring support', function()
|
||||
]])
|
||||
feed('<CR>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
|
|
||||
:# |
|
||||
{ERR:Error detected while processing :} |
|
||||
{ERR:E605: Exception not caught: 42} |
|
||||
{ERR:E749: empty buffer} |
|
||||
{PE:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
eq('Error detected while processing :\nE605: Exception not caught: 42',
|
||||
feed('<CR>')
|
||||
eq('Error detected while processing :\nE605: Exception not caught: 42\nE749: empty buffer',
|
||||
meths.command_output('messages'))
|
||||
end)
|
||||
it('errors out when failing to get callback', function()
|
||||
|
@ -1539,7 +1539,7 @@ describe("'inccommand' and :cnoremap", function()
|
||||
end
|
||||
end)
|
||||
|
||||
it('does not work with a failing mapping', function()
|
||||
it('still works with a broken mapping', function()
|
||||
for _, case in pairs(cases) do
|
||||
refresh(case)
|
||||
feed_command("cnoremap <expr> x execute('bwipeout!')[-1].'x'")
|
||||
@ -1548,7 +1548,10 @@ describe("'inccommand' and :cnoremap", function()
|
||||
|
||||
-- error thrown b/c of the mapping
|
||||
neq(nil, eval('v:errmsg'):find('^E523:'))
|
||||
expect(default_text)
|
||||
expect([[
|
||||
Inc substitution on
|
||||
toxo lines
|
||||
]])
|
||||
end
|
||||
end)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user