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 copy on select is false then exit early.
|
||||||
if (self.config.copy_on_select == .false) return;
|
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
|
// again if it changed, since setting the clipboard can be an expensive
|
||||||
// operation.
|
// operation.
|
||||||
const sel = sel_ orelse return;
|
const sel = sel_ orelse return;
|
||||||
@ -3109,8 +3109,10 @@ pub fn mouseButtonCallback(
|
|||||||
// If we already have a selection and the selection contains
|
// If we already have a selection and the selection contains
|
||||||
// where we clicked then we don't want to modify the selection.
|
// where we clicked then we don't want to modify the selection.
|
||||||
if (self.io.terminal.screen.selection) |prev_sel| {
|
if (self.io.terminal.screen.selection) |prev_sel| {
|
||||||
try self.copyOnMouseAction(prev_sel, self.config.copy_on_right_click);
|
if (prev_sel.contains(screen, pin)) {
|
||||||
if (prev_sel.contains(screen, pin)) break :sel;
|
try self.copyOnMouseAction(prev_sel, self.config.copy_on_right_click);
|
||||||
|
break :sel;
|
||||||
|
}
|
||||||
// The selection doesn't contain our pin, so we create a new
|
// The selection doesn't contain our pin, so we create a new
|
||||||
// word selection where we clicked.
|
// word selection where we clicked.
|
||||||
}
|
}
|
||||||
|
@ -1512,11 +1512,7 @@ keybind: Keybinds = .{},
|
|||||||
else => .false,
|
else => .false,
|
||||||
},
|
},
|
||||||
|
|
||||||
@"copy-on-right-click": CopyOnMouseAction = switch (builtin.os.tag) {
|
@"copy-on-right-click": CopyOnMouseAction = .false,
|
||||||
.linux => .false,
|
|
||||||
.macos => .false,
|
|
||||||
else => .false,
|
|
||||||
},
|
|
||||||
|
|
||||||
/// The time in milliseconds between clicks to consider a click a repeat
|
/// 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
|
/// (double, triple, etc.) or an entirely new single click. A value of zero will
|
||||||
|
Reference in New Issue
Block a user