some comments, make switch exaustive

This commit is contained in:
Mitchell Hashimoto
2023-11-06 14:42:10 -08:00
parent 9a64697433
commit d20c4866b1
2 changed files with 5 additions and 1 deletions

View File

@ -1121,6 +1121,9 @@ pub fn keyCallback(
self.hideMouse(); self.hideMouse();
} }
// When we are in the middle of a mouse event and we press shift,
// we change the mouse to a text shape so that selection appears
// possible.
if (self.io.terminal.flags.mouse_event != .none and if (self.io.terminal.flags.mouse_event != .none and
event.physical_key == .left_shift or event.physical_key == .left_shift or
event.physical_key == .right_shift) event.physical_key == .right_shift)
@ -1128,7 +1131,7 @@ pub fn keyCallback(
switch (event.action) { switch (event.action) {
.press => try self.rt_surface.setMouseShape(.text), .press => try self.rt_surface.setMouseShape(.text),
.release => try self.rt_surface.setMouseShape(self.io.terminal.mouse_shape), .release => try self.rt_surface.setMouseShape(self.io.terminal.mouse_shape),
else => {}, .repeat => {},
} }
} }

View File

@ -85,6 +85,7 @@ previous_char: ?u21 = null,
/// The modes that this terminal currently has active. /// The modes that this terminal currently has active.
modes: modes.ModeState = .{}, modes: modes.ModeState = .{},
/// The most recently set mouse shape for the terminal.
mouse_shape: mouse_shape.MouseShape = .text, mouse_shape: mouse_shape.MouseShape = .text,
/// These are just a packed set of flags we may set on the terminal. /// These are just a packed set of flags we may set on the terminal.