Skip to content

Commit

Permalink
improve diagnostic jump and show window close #1319
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Oct 13, 2023
1 parent 5807d38 commit eb7b2ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/lspsaga/diagnostic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function diag:move_cursor(entry)
if width <= 0 then
width = #api.nvim_get_current_line()
end
jump_beacon({ entry.lnum, entry.col }, width)
jump_beacon({ entry.lnum, entry.col or entry.end_col }, width)
-- Open folds under the cursor
vim.cmd('normal! zv')
end)
Expand Down
5 changes: 5 additions & 0 deletions lua/lspsaga/diagnostic/show.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ function sd:show(opt)
end

function sd:show_diagnostics(opt)
local has_jump_win = require('lspsaga.diagnostic').winid
if has_jump_win and api.nvim_win_is_valid(has_jump_win) then
return
end

local entrys = diag:get_diagnostic(opt)
if next(entrys) == nil then
return
Expand Down

0 comments on commit eb7b2ed

Please sign in to comment.