mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
functests: Make “stops executing callback” test work
Needed to be adjusted to use input() (previously relied on side-effects of executing `:cmd`) and dismiss something (hidden “Press ENTER” message?).
This commit is contained in:
@@ -24,8 +24,9 @@ before_each(function()
|
|||||||
redraw!
|
redraw!
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
let g:EMPTY = ''
|
||||||
cnoremap <expr> {REDRAW} Redraw()
|
cnoremap <expr> {REDRAW} Redraw()
|
||||||
nnoremap <expr> {PROMPT} input({"prompt": ":", "highlight": g:Nvim_color_input})[1:0]
|
nnoremap <expr> {PROMPT} extend(g:, {"out": input({"prompt": ":", "highlight": g:Nvim_color_input})}).EMPTY
|
||||||
function RainBowParens(cmdline)
|
function RainBowParens(cmdline)
|
||||||
let ret = []
|
let ret = []
|
||||||
let i = 0
|
let i = 0
|
||||||
@@ -295,13 +296,34 @@ describe('Command-line coloring', function()
|
|||||||
start_prompt('e')
|
start_prompt('e')
|
||||||
-- FIXME Does not work well with :throw: error message overwrites cmdline.
|
-- FIXME Does not work well with :throw: error message overwrites cmdline.
|
||||||
end)
|
end)
|
||||||
pending('stops executing callback after a number of errors'--[[, function()
|
it('stops executing callback after a number of errors', function()
|
||||||
set_color_cb('SplittedMultibyteStart')
|
set_color_cb('SplittedMultibyteStart')
|
||||||
start_prompt('let x = "«»«»«»«»«»"\n')
|
start_prompt('let x = "«»«»«»«»«»"\n')
|
||||||
eq('«»«»«»«»«»', meths.get_var('x'))
|
screen:expect([[
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
:let x = " |
|
||||||
|
{ERR:E5405: Chunk 0 start 10 splits multibyte}|
|
||||||
|
{ERR: character} |
|
||||||
|
^:let x = "«»«»«»«»«»" |
|
||||||
|
]])
|
||||||
|
feed('\n')
|
||||||
|
screen:expect([[
|
||||||
|
^ |
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
{EOB:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
eq('let x = "«»«»«»«»«»"', meths.get_var('out'))
|
||||||
local msg = '\nE5405: Chunk 0 start 10 splits multibyte character'
|
local msg = '\nE5405: Chunk 0 start 10 splits multibyte character'
|
||||||
eq(msg:rep(1), funcs.execute('messages'))
|
eq(msg:rep(1), funcs.execute('messages'))
|
||||||
end]])
|
end)
|
||||||
it('allows interrupting callback with <C-c>', function()
|
it('allows interrupting callback with <C-c>', function()
|
||||||
if true then return pending('<C-c> does not work well enough now') end
|
if true then return pending('<C-c> does not work well enough now') end
|
||||||
set_color_cb('Halting')
|
set_color_cb('Halting')
|
||||||
|
Reference in New Issue
Block a user