diff options
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index ba170ba8c5..55535a92e5 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1439,6 +1439,24 @@ describe('API', function() nvim('set_option_value', 'autoread', NIL, {scope = 'local'}) eq(NIL, nvim('get_option_value', 'autoread', {scope = 'local'})) end) + + it('set window options', function() + -- Same as to nvim_win_set_option + nvim('set_option_value', 'colorcolumn', '4,3', {win=0}) + eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + command("set modified hidden") + command("enew") -- edit new buffer, window option is preserved + eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + end) + + it('set local window options', function() + -- Different to nvim_win_set_option + nvim('set_option_value', 'colorcolumn', '4,3', {win=0, scope='local'}) + eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + command("set modified hidden") + command("enew") -- edit new buffer, window option is reset + eq('', nvim('get_option_value', 'colorcolumn', {scope = 'local'})) + end) end) describe('nvim_{get,set}_current_buf, nvim_list_bufs', function() @@ -3102,6 +3120,19 @@ describe('API', function() 'TextWithNoHighlight%#WarningMsg#TextWithWarningHighlight', { use_tabline = true, highlights = true })) end) + it('works with winbar', function() + eq({ + str = 'TextWithNoHighlightTextWithWarningHighlight', + width = 43, + highlights = { + { start = 0, group = 'WinBar' }, + { start = 19, group = 'WarningMsg' } + } + }, + meths.eval_statusline( + 'TextWithNoHighlight%#WarningMsg#TextWithWarningHighlight', + { use_winbar = true, highlights = true })) + end) end) end) describe('nvim_parse_cmd', function() @@ -3623,5 +3654,13 @@ describe('API', function() meths.cmd({ cmd = "update" }, {}) meths.cmd({ cmd = "buffer", count = 0 }, {}) end) + it('doesn\'t suppress errors when used in keymapping', function() + meths.exec_lua([[ + vim.keymap.set("n", "[l", + function() vim.api.nvim_cmd({ cmd = "echo", args = {"foo"} }, {}) end) + ]], {}) + feed("[l") + neq(nil, string.find(eval("v:errmsg"), "E5108:")) + end) end) end) |