aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/diagnostic_spec.lua
diff options
context:
space:
mode:
authormohsen <36933074+smoka7@users.noreply.github.com>2022-06-08 23:25:39 +0430
committerGitHub <noreply@github.com>2022-06-08 12:55:39 -0600
commit94181ad7dcb75e1e188164276696434e03302a21 (patch)
tree0fe9190761e4077df08505354e32b2a0a1049059 /test/functional/lua/diagnostic_spec.lua
parent4d9e2247c939a5df0a79a06f37ab882ff66aeb01 (diff)
downloadrneovim-94181ad7dcb75e1e188164276696434e03302a21.tar.gz
rneovim-94181ad7dcb75e1e188164276696434e03302a21.tar.bz2
rneovim-94181ad7dcb75e1e188164276696434e03302a21.zip
fix(diagnostic): check for negative column value (#18868)
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 7f929db8bf..f9647f5b6a 100644
--- a/test/functional/lua/diagnostic_spec.lua
+++ b/test/functional/lua/diagnostic_spec.lua
@@ -729,6 +729,19 @@ describe('vim.diagnostic', function()
return vim.diagnostic.get_next_pos { namespace = diagnostic_ns }
]])
end)
+
+ it('works with diagnostics before the start of the line', 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, -1, 4, -1),
+ })
+ 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()