diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/functional/lua/diagnostic_spec.lua | 23 | ||||
| -rw-r--r-- | test/functional/lua/ui_event_spec.lua | 15 | ||||
| -rw-r--r-- | test/old/testdir/test_autocmd.vim | 3 |
3 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua index 534d78fd09..2e6f7fbf36 100644 --- a/test/functional/lua/diagnostic_spec.lua +++ b/test/functional/lua/diagnostic_spec.lua @@ -1101,6 +1101,29 @@ describe('vim.diagnostic', function() ]] ) end) + + it('works on blank line #28397', function() + eq( + { 0, 2 }, + exec_lua [[ + local test_bufnr = vim.api.nvim_create_buf(true, false) + vim.api.nvim_buf_set_lines(test_bufnr, 0, -1, false, { + 'first line', + '', + '', + 'end line', + }) + vim.diagnostic.set(diagnostic_ns, test_bufnr, { + make_info('Diagnostic #1', 0, 2, 0, 2), + make_info('Diagnostic #2', 2, 0, 2, 0), + make_info('Diagnostic #3', 2, 0, 2, 0), + }) + vim.api.nvim_win_set_buf(0, test_bufnr) + vim.api.nvim_win_set_cursor(0, {3, 0}) + return vim.diagnostic.get_prev_pos { namespace = diagnostic_ns} + ]] + ) + end) end) describe('get()', function() diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 5fe51a2c35..ae39172145 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -155,6 +155,21 @@ describe('vim.ui_attach', function() }, }, actual, vim.inspect(actual)) end) + + it('ui_refresh() works without remote UI', function() + screen:detach() + exec_lua('vim.ui_attach(ns, { ext_messages = true }, on_event)') + n.api.nvim_set_option_value('cmdheight', 1, {}) + screen:attach() + eq(1, n.api.nvim_get_option_value('cmdheight', {})) + end) + + it("ui_refresh() sets 'cmdheight' for all open tabpages with ext_messages", function() + exec_lua('vim.cmd.tabnew()') + exec_lua('vim.ui_attach(ns, { ext_messages = true }, on_event)') + exec_lua('vim.cmd.tabnext()') + eq(0, n.api.nvim_get_option_value('cmdheight', {})) + end) end) describe('vim.ui_attach', function() diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index ddc595e116..cdcd68f3d6 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -4113,6 +4113,9 @@ func Test_BufEnter_botline() edit Xxx2 au BufEnter Xxx1 call assert_true(line('w$') > 1) edit Xxx1 + + bwipe! Xxx1 + bwipe! Xxx2 au! BufEnter Xxx1 set hidden&vim endfunc |