mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
feat(lsp,diagnostic): open folds in jump-related functions
This commit is contained in:
parent
76af219e3e
commit
ddf545c152
@ -508,10 +508,13 @@ local function diagnostic_move_pos(opts, pos)
|
||||
return
|
||||
end
|
||||
|
||||
-- Save position in the window's jumplist
|
||||
vim.api.nvim_win_call(win_id, function() vim.cmd("normal! m'") end)
|
||||
|
||||
vim.api.nvim_win_set_cursor(win_id, {pos[1] + 1, pos[2]})
|
||||
vim.api.nvim_win_call(win_id, function()
|
||||
-- Save position in the window's jumplist
|
||||
vim.cmd("normal! m'")
|
||||
vim.api.nvim_win_set_cursor(win_id, {pos[1] + 1, pos[2]})
|
||||
-- Open folds under the cursor
|
||||
vim.cmd("normal! zv")
|
||||
end)
|
||||
|
||||
if float then
|
||||
local float_opts = type(float) == "table" and float or {}
|
||||
|
@ -965,6 +965,8 @@ function M.jump_to_location(location)
|
||||
local row = range.start.line
|
||||
local col = get_line_byte_from_position(0, range.start)
|
||||
api.nvim_win_set_cursor(0, {row + 1, col})
|
||||
-- Open folds under the cursor
|
||||
vim.cmd("normal! zv")
|
||||
return true
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user