mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Moved copy to break condition, fixed syntax and config
This commit is contained in:
@ -1465,7 +1465,7 @@ fn setSelection(self: *Surface, sel_: ?terminal.Selection) !void {
|
||||
// If copy on select is false then exit early.
|
||||
if (self.config.copy_on_select == .false) return;
|
||||
|
||||
// clear the clipboard. If the selection is set, we only set the clipboard
|
||||
// Clear the clipboard. If the selection is set, we only set the clipboard
|
||||
// again if it changed, since setting the clipboard can be an expensive
|
||||
// operation.
|
||||
const sel = sel_ orelse return;
|
||||
@ -3109,8 +3109,10 @@ pub fn mouseButtonCallback(
|
||||
// If we already have a selection and the selection contains
|
||||
// where we clicked then we don't want to modify the selection.
|
||||
if (self.io.terminal.screen.selection) |prev_sel| {
|
||||
if (prev_sel.contains(screen, pin)) {
|
||||
try self.copyOnMouseAction(prev_sel, self.config.copy_on_right_click);
|
||||
if (prev_sel.contains(screen, pin)) break :sel;
|
||||
break :sel;
|
||||
}
|
||||
// The selection doesn't contain our pin, so we create a new
|
||||
// word selection where we clicked.
|
||||
}
|
||||
|
@ -1512,11 +1512,7 @@ keybind: Keybinds = .{},
|
||||
else => .false,
|
||||
},
|
||||
|
||||
@"copy-on-right-click": CopyOnMouseAction = switch (builtin.os.tag) {
|
||||
.linux => .false,
|
||||
.macos => .false,
|
||||
else => .false,
|
||||
},
|
||||
@"copy-on-right-click": CopyOnMouseAction = .false,
|
||||
|
||||
/// The time in milliseconds between clicks to consider a click a repeat
|
||||
/// (double, triple, etc.) or an entirely new single click. A value of zero will
|
||||
|
Reference in New Issue
Block a user