fix: store jump location source before navigating to another file

This commit is contained in:
CJ van den Berg 2024-04-09 22:32:46 +02:00
parent 390a56714a
commit 48fc8a968c
2 changed files with 2 additions and 1 deletions

View file

@ -1047,7 +1047,7 @@ pub const Editor = struct {
try self.send_editor_cursel_msg("modified", self.get_primary()); try self.send_editor_cursel_msg("modified", self.get_primary());
} }
fn send_editor_jump_source(self: *Self) !void { pub fn send_editor_jump_source(self: *Self) !void {
try self.send_editor_cursel_msg("jump_source", self.get_primary()); try self.send_editor_cursel_msg("jump_source", self.get_primary());
} }

View file

@ -199,6 +199,7 @@ const cmds = struct {
else else
false else false; false else false;
if (!same_file) { if (!same_file) {
if (self.editor) |editor| editor.send_editor_jump_source() catch {};
try self.create_editor(); try self.create_editor();
try command.executeName("open_file", command.fmt(.{f})); try command.executeName("open_file", command.fmt(.{f}));
} }