aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/diagnostic_spec.lua
diff options
context:
space:
mode:
authorGregory Anders <greg@gpanders.com>2021-11-19 11:31:33 -0700
committerGregory Anders <greg@gpanders.com>2021-11-19 11:37:45 -0700
commit34bb5fa5a942708c32b0e68eca02261d04e51ca6 (patch)
tree23d90480e23d49fe35d7f6d55725e84f6851675c /test/functional/lua/diagnostic_spec.lua
parent2abc799ffd8b3b250f0ffce2f74a930ad3d19cf3 (diff)
downloadrneovim-34bb5fa5a942708c32b0e68eca02261d04e51ca6.tar.gz
rneovim-34bb5fa5a942708c32b0e68eca02261d04e51ca6.tar.bz2
rneovim-34bb5fa5a942708c32b0e68eca02261d04e51ca6.zip
fix(diagnostic): fix navigation with diagnostics placed past end of line
Diffstat (limited to 'test/functional/lua/diagnostic_spec.lua')
-rw-r--r--test/functional/lua/diagnostic_spec.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua
index 00e261c01d..cdf9a8a834 100644
--- a/test/functional/lua/diagnostic_spec.lua
+++ b/test/functional/lua/diagnostic_spec.lua
@@ -686,6 +686,19 @@ describe('vim.diagnostic', function()
return vim.diagnostic.get_prev_pos { namespace = diagnostic_ns }
]])
end)
+
+ it('works with diagnostics past the end of the line #16349', function()
+ eq({4, 0}, exec_lua [[
+ vim.diagnostic.set(diagnostic_ns, diagnostic_bufnr, {
+ make_error('Diagnostic #1', 3, 9001, 3, 9001),
+ make_error('Diagnostic #2', 4, 0, 4, 0),
+ })
+ vim.api.nvim_win_set_buf(0, diagnostic_bufnr)
+ vim.api.nvim_win_set_cursor(0, {1, 1})
+ vim.diagnostic.goto_next { float = false }
+ return vim.diagnostic.get_next_pos { namespace = diagnostic_ns }
+ ]])
+ end)
end)
describe('get_prev_pos()', function()