From aa6b9c677d83d76d448c3bb0973bf8d14bfdf922 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 8 Jun 2024 21:40:18 +0200 Subject: refactor: use `vim._with` where possible This mostly means replacing `nvim_buf_call` and `nvim_win_call` with `vim._with`. --- runtime/lua/vim/diagnostic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/diagnostic.lua') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 3be22556ab..43954358a3 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -964,7 +964,7 @@ local function goto_diagnostic(diagnostic, opts) local winid = opts.winid or api.nvim_get_current_win() - api.nvim_win_call(winid, function() + vim._with({ win = winid }, function() -- Save position in the window's jumplist vim.cmd("normal! m'") api.nvim_win_set_cursor(winid, { diagnostic.lnum + 1, diagnostic.col }) -- cgit