Compare commits
3 commits
b7d825e82c
...
537464093a
Author | SHA1 | Date | |
---|---|---|---|
537464093a | |||
8454ebc9f4 | |||
bcf4babd9f |
2 changed files with 10 additions and 3 deletions
|
@ -247,7 +247,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", .{});
|
||||
|
@ -256,6 +256,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(.{
|
||||
|
|
|
@ -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.* };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue