mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
feat(defaults): use vim.diagnostic.jump() for default mappings (#29066)
This allows the mappings to work with a count and also enables new ]D and [D mappings to go to the last/first diagnostic in the buffer.
This commit is contained in:
@@ -969,7 +969,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 3, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next({_highest = true})
|
||||
vim.diagnostic.jump({ count = 1, _highest = true })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -977,7 +977,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 5, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next({_highest = true})
|
||||
vim.diagnostic.jump({ count = 1, _highest = true })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -998,7 +998,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 4, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next({_highest = true})
|
||||
vim.diagnostic.jump({ count = 1, _highest = true })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -1006,7 +1006,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 6, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next({_highest = true})
|
||||
vim.diagnostic.jump({ count = 1, _highest = true })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -1028,7 +1028,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 2, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next()
|
||||
vim.diagnostic.jump({ count = 1 })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -1036,7 +1036,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 3, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next()
|
||||
vim.diagnostic.jump({ count = 1 })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -1044,7 +1044,7 @@ describe('vim.diagnostic', function()
|
||||
eq(
|
||||
{ 4, 0 },
|
||||
exec_lua([[
|
||||
vim.diagnostic.goto_next()
|
||||
vim.diagnostic.jump({ count = 1 })
|
||||
return vim.api.nvim_win_get_cursor(0)
|
||||
]])
|
||||
)
|
||||
@@ -1107,7 +1107,7 @@ describe('vim.diagnostic', function()
|
||||
})
|
||||
vim.api.nvim_win_set_buf(0, diagnostic_bufnr)
|
||||
vim.api.nvim_win_set_cursor(0, {3, 1})
|
||||
local prev = vim.diagnostic.get_prev({ namespace = diagnostic_ns, wrap = false})
|
||||
local prev = vim.diagnostic.get_prev({ namespace = diagnostic_ns, wrap = false })
|
||||
return prev
|
||||
]]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user