vim/util: center on destination when jumping to diagnostic
This commit is contained in:
parent
3d43af1e8d
commit
982d49be77
1 changed files with 2 additions and 0 deletions
|
@ -88,12 +88,14 @@ local diag_opts = {
|
|||
---@param opts table: options passed along to `vim.diagnostic.goto_next`.
|
||||
M.goto_next_diagnostic = function(opts)
|
||||
vim.diagnostic.goto_next(vim.tbl_extend('keep', opts or {}, diag_opts))
|
||||
vim.cmd 'normal zz'
|
||||
end
|
||||
|
||||
--- Move to the previous diagnostic.
|
||||
---@param opts table: options passed along to `vim.diagnostic.goto_prev`.
|
||||
M.goto_prev_diagnostic = function(opts)
|
||||
vim.diagnostic.goto_prev(vim.tbl_extend('keep', opts or {}, diag_opts))
|
||||
vim.cmd 'normal zz'
|
||||
end
|
||||
|
||||
--- Whether the current window is the last in a given direction.
|
||||
|
|
Loading…
Add table
Reference in a new issue