fix: only fallback to get_next_file in get_next_diagnostic if it is available
This commit is contained in:
parent
32f00daf76
commit
70ec2a11c5
1 changed files with 10 additions and 2 deletions
|
@ -3320,7 +3320,11 @@ pub const Editor = struct {
|
|||
}
|
||||
|
||||
pub fn goto_next_diagnostic(self: *Self, _: Context) Result {
|
||||
if (self.diagnostics.items.len == 0) return command.executeName("goto_next_file", .{});
|
||||
if (self.diagnostics.items.len == 0) {
|
||||
if (command.getId("goto_next_file")) |id|
|
||||
return command.execute(id, .{});
|
||||
return;
|
||||
}
|
||||
self.sort_diagnostics();
|
||||
const primary = self.get_primary();
|
||||
for (self.diagnostics.items) |*diag| {
|
||||
|
@ -3331,7 +3335,11 @@ pub const Editor = struct {
|
|||
}
|
||||
|
||||
pub fn goto_prev_diagnostic(self: *Self, _: Context) Result {
|
||||
if (self.diagnostics.items.len == 0) return command.executeName("goto_prev_file", .{});
|
||||
if (self.diagnostics.items.len == 0) {
|
||||
if (command.getId("goto_prev_file")) |id|
|
||||
return command.execute(id, .{});
|
||||
return;
|
||||
}
|
||||
self.sort_diagnostics();
|
||||
const primary = self.get_primary();
|
||||
var i = self.diagnostics.items.len - 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue