neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit d918ebe3b8a5ee2a7ad735e2edd474cc1224ea28
parent 51d85f7ea58bd715cec1fdfa8d19826cafe7185d
Author: Max Coplan <mchcopl@gmail.com>
Date:   Tue,  9 Jul 2024 12:08:12 -0700

fix(diagnostic): fix backwards compatibility for goto_next and goto_prev (#29593)


Diffstat:
Mruntime/doc/deprecated.txt | 4++--
Mruntime/lua/vim/diagnostic.lua | 4++++
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt @@ -23,8 +23,8 @@ LUA - vim.region() Use |getregionpos()| instead. DIAGNOSTICS -- *vim.diagnostic.goto_next()* Use |vim.diagnostic.jump()| with `{count = 1}` instead. -- *vim.diagnostic.goto_prev()* Use |vim.diagnostic.jump()| with `{count = -1}` instead. +- *vim.diagnostic.goto_next()* Use |vim.diagnostic.jump()| with `{count=1, float=true}` instead. +- *vim.diagnostic.goto_prev()* Use |vim.diagnostic.jump()| with `{count=-1, float=true}` instead. - *vim.diagnostic.get_next_pos()* Use the "lnum" and "col" fields from the return value of |vim.diagnostic.get_next()| instead. diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua @@ -1194,6 +1194,8 @@ end ---@deprecated function M.goto_prev(opts) vim.deprecate('vim.diagnostic.goto_prev()', 'vim.diagnostic.jump()', '0.13') + opts = opts or {} + opts.float = if_nil(opts.float, true) goto_diagnostic(M.get_prev(opts), opts) end @@ -1339,6 +1341,8 @@ end ---@deprecated function M.goto_next(opts) vim.deprecate('vim.diagnostic.goto_next()', 'vim.diagnostic.jump()', '0.13') + opts = opts or {} + opts.float = if_nil(opts.float, true) goto_diagnostic(M.get_next(opts), opts) end