mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
adjust_selection keybind should not be consumed if no selection
This commit is contained in:
@ -3456,12 +3456,17 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
|||||||
|
|
||||||
.quit => try self.app.setQuit(),
|
.quit => try self.app.setQuit(),
|
||||||
|
|
||||||
.adjust_selection => |direction| adjust_selection: {
|
.adjust_selection => |direction| {
|
||||||
self.renderer_state.mutex.lock();
|
self.renderer_state.mutex.lock();
|
||||||
defer self.renderer_state.mutex.unlock();
|
defer self.renderer_state.mutex.unlock();
|
||||||
|
|
||||||
const screen = &self.io.terminal.screen;
|
const screen = &self.io.terminal.screen;
|
||||||
const sel = if (screen.selection) |*sel| sel else break :adjust_selection;
|
const sel = if (screen.selection) |*sel| sel else {
|
||||||
|
// If we don't have a selection we do not perform this
|
||||||
|
// action, allowing the keybind to fall through to the
|
||||||
|
// terminal.
|
||||||
|
return false;
|
||||||
|
};
|
||||||
sel.adjust(screen, switch (direction) {
|
sel.adjust(screen, switch (direction) {
|
||||||
.left => .left,
|
.left => .left,
|
||||||
.right => .right,
|
.right => .right,
|
||||||
|
Reference in New Issue
Block a user