refactor: send file path in highlight reference messages

This commit is contained in:
CJ van den Berg 2026-01-12 16:03:03 +01:00
parent 6a2228e19d
commit 021dfa8d4c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 11 additions and 7 deletions

View file

@ -165,13 +165,13 @@ pub fn receive(self: *Self, from_: tp.pid_ref, m: tp.message) error{Exit}!bool {
}
self.find_in_files_state = .done;
return true;
} else if (try m.match(.{ "HREF", tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos) })) {
} else if (try m.match(.{ "HREF", tp.extract(&path), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos) })) {
if (self.get_active_editor()) |editor| editor.add_highlight_reference(.{
.begin = .{ .row = begin_line, .col = begin_pos },
.end = .{ .row = end_line, .col = end_pos },
});
return true;
} else if (try m.match(.{ "HREF", "done" })) {
} else if (try m.match(.{ "HREF", tp.extract(&path), "done" })) {
if (self.get_active_editor()) |editor| editor.done_highlight_reference();
return true;
} else if (try m.match(.{ "hover", tp.extract(&path), tp.string, tp.extract(&lines), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos) })) {