fix: diagnostics lnum starts with 1 (#892)

This commit is contained in:
yetone
2024-11-23 23:08:10 +08:00
committed by GitHub
parent 9042f5f202
commit 67e946ef13
4 changed files with 40 additions and 9 deletions

View File

@@ -1542,8 +1542,8 @@ function Sidebar:create_input(opts)
local diagnostics = nil
if mentions.enable_diagnostics then
if self.selected_code ~= nil then
diagnostics = Utils.get_current_selection_diagnostics()
if self.code ~= nil and self.code.bufnr ~= nil and self.code.selection ~= nil then
diagnostics = Utils.get_current_selection_diagnostics(self.code.bufnr, self.code.selection)
else
diagnostics = Utils.get_diagnostics(self.code.bufnr)
end