diff options
author | James McCoy <jamessan@jamessan.com> | 2017-01-18 15:13:59 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-02-01 18:28:32 -0500 |
commit | 7e7f01a3be90a4024d779a4032e5a914f850abdc (patch) | |
tree | 732d5e8f695fcaa11dcb96942bcf8ea8dc53789d /test/functional/eval/execute_spec.lua | |
parent | 3803314f7808838fc8c627915878631383ee612d (diff) | |
download | rneovim-7e7f01a3be90a4024d779a4032e5a914f850abdc.tar.gz rneovim-7e7f01a3be90a4024d779a4032e5a914f850abdc.tar.bz2 rneovim-7e7f01a3be90a4024d779a4032e5a914f850abdc.zip |
execute: Correctly capture output with highlight attributes
Closes #5422
Diffstat (limited to 'test/functional/eval/execute_spec.lua')
-rw-r--r-- | test/functional/eval/execute_spec.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index cc9b61b842..5614935ec2 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -8,6 +8,7 @@ local exc_exec = helpers.exc_exec local funcs = helpers.funcs local Screen = require('test.functional.ui.screen') local command = helpers.command +local feed = helpers.feed describe('execute()', function() before_each(clear) @@ -69,6 +70,25 @@ describe('execute()', function() eq('Vim:E729: using Funcref as a String', ret) end) + it('captures output with highlights', function() + eq('\nErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red', + eval('execute("hi ErrorMsg")')) + end) + + it('does not corrupt the command display #5422', function() + local screen = Screen.new(70, 5) + screen:attach() + feed(':echo execute("hi ErrorMsg")<CR>') + screen:expect([[ + ~ | + ~ | + :echo execute("hi ErrorMsg") | + ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red | + Press ENTER or type command to continue^ | + ]]) + feed('<CR>') + end) + -- This matches Vim behavior. it('does not capture shell-command output', function() eq('\n:!echo "foo"\13\n', funcs.execute('!echo "foo"')) |