From bcf4babd9fa936125d83e17fb81f84617ff89ebd Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sat, 23 Aug 2025 19:00:11 +0200 Subject: [PATCH 1/2] fix: allow helix mode paste_after command to work at the end of the file closes #288 --- src/tui/mode/helix.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tui/mode/helix.zig b/src/tui/mode/helix.zig index 80a998b..7b56c3d 100644 --- a/src/tui/mode/helix.zig +++ b/src/tui/mode/helix.zig @@ -327,7 +327,7 @@ fn move_cursor_word_right_end_helix(root: Buffer.Root, cursor: *Cursor, metrics: fn insert(ed: *Editor, root: Buffer.Root, cursel: *CurSel, s: []const u8, allocator: std.mem.Allocator) !Buffer.Root { var root_ = root; const cursor = &cursel.cursor; - if (cursel.selection == null) try cursor.move_right(root_, ed.metrics); + if (cursel.selection == null) cursor.move_right(root_, ed.metrics) catch {}; const begin = cursel.cursor; cursor.row, cursor.col, root_ = try root_.insert_chars(cursor.row, cursor.col, s, allocator, ed.metrics); cursor.target = cursor.col; @@ -342,7 +342,7 @@ fn insert_line(ed: *Editor, root: Buffer.Root, cursel: *CurSel, s: []const u8, a cursel.disable_selection(root, ed.metrics); cursel.cursor.move_end(root, ed.metrics); var begin = cursel.cursor; - try begin.move_right(root, ed.metrics); + begin.move_right(root, ed.metrics) catch {}; cursor.row, cursor.col, root_ = try root_.insert_chars(cursor.row, cursor.col, s, allocator, ed.metrics); cursor.target = cursor.col; cursel.selection = Selection{ .begin = begin, .end = cursor.* }; From 8454ebc9f44403f9ab805118e5d06e75cba86b30 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 24 Aug 2025 16:45:46 +0200 Subject: [PATCH 2/2] feat: add check for kitty scaled text support --- src/renderer/vaxis/renderer.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/vaxis/renderer.zig b/src/renderer/vaxis/renderer.zig index e388db0..e9e9e02 100644 --- a/src/renderer/vaxis/renderer.zig +++ b/src/renderer/vaxis/renderer.zig @@ -244,7 +244,7 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void { const event = std.mem.bytesAsValue(vaxis.Event, input_); switch (event.*) { .key_press => |key__| { - // Check for a cursor position response for our explicity width query. This will + // Check for a cursor position response for our explicit width query. This will // always be an F3 key with shift = true, and we must be looking for queries if (key__.codepoint == vaxis.Key.f3 and key__.mods.shift and !self.queries_done) { self.logger.print("explicit width capability detected", .{}); @@ -253,6 +253,13 @@ pub fn process_renderer_event(self: *Self, msg: []const u8) Error!void { self.vx.screen.width_method = .unicode; return; } + // Check for a cursor position response for our scaled text query. This will + // always be an F3 key with alt = true, and we must be looking for queries + if (key__.codepoint == vaxis.Key.f3 and key__.mods.alt and !self.queries_done) { + self.logger.print("scaled text capability detected", .{}); + self.vx.caps.scaled_text = true; + return; + } const key_ = filter_mods(normalize_shifted_alphas(key__)); try self.sync_mod_state(key_.codepoint, key_.mods); const cbor_msg = try self.fmtmsg(.{