fix: use +1 row offsets when adding diagnostics to file list

This commit is contained in:
CJ van den Berg 2024-08-18 16:39:20 +02:00
parent 4127cf8bcf
commit a71a8cfc6e

View file

@ -433,7 +433,16 @@ const cmds = struct {
if (self.editor) |editor| if (std.mem.eql(u8, file_path, editor.file_path orelse "")) if (self.editor) |editor| if (std.mem.eql(u8, file_path, editor.file_path orelse ""))
try editor.add_diagnostic(file_path, source, code, message, severity, sel) try editor.add_diagnostic(file_path, source, code, message, severity, sel)
else else
try self.add_find_in_files_result(.diagnostics, file_path, sel.begin.row, sel.begin.col, sel.end.row, sel.end.col, message, ed.Diagnostic.to_severity(severity)); try self.add_find_in_files_result(
.diagnostics,
file_path,
sel.begin.row + 1,
sel.begin.col,
sel.end.row + 1,
sel.end.col,
message,
ed.Diagnostic.to_severity(severity),
);
} }
pub fn clear_diagnostics(self: *Self, ctx: Ctx) Result { pub fn clear_diagnostics(self: *Self, ctx: Ctx) Result {