fix: gutter click past end of file

This commit is contained in:
CJ van den Berg 2024-03-10 21:08:47 +01:00
parent b87e1a867b
commit c9bd11667c

View file

@ -219,6 +219,7 @@ inline fn render_diff_symbols(self: *Self, diff_symbols: *[]Symbol, pos: usize,
fn primary_click(self: *const Self, y: i32) error{Exit}!bool {
var line = self.row + 1;
line += @intCast(y);
if (line > self.lines) line = self.lines;
try command.executeName("goto_line", command.fmt(.{line}));
try command.executeName("goto_column", command.fmt(.{1}));
try command.executeName("select_end", .{});