mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-18 09:46:07 +03:00
fix: make regular URLs work with either ctrl or super modifiers
This commit is contained in:
@ -3698,7 +3698,17 @@ fn linkAtPos(
|
|||||||
for (self.config.links) |link| {
|
for (self.config.links) |link| {
|
||||||
switch (link.highlight) {
|
switch (link.highlight) {
|
||||||
.always, .hover => {},
|
.always, .hover => {},
|
||||||
.always_mods, .hover_mods => |v| if (!v.equal(mouse_mods)) continue,
|
.always_mods, .hover_mods => |v| {
|
||||||
|
// Special case: if the expected mods are "ctrl or super" (like the default URL config),
|
||||||
|
// then we should match if the user pressed either ctrl or super, just like OSC8 links.
|
||||||
|
const is_ctrl_or_super_expected = (v.ctrl and !v.super and !v.shift and !v.alt) or
|
||||||
|
(v.super and !v.ctrl and !v.shift and !v.alt);
|
||||||
|
if (is_ctrl_or_super_expected) {
|
||||||
|
if (!(mouse_mods.ctrl or mouse_mods.super)) continue;
|
||||||
|
} else {
|
||||||
|
if (!v.equal(mouse_mods)) continue;
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var it = strmap.searchIterator(link.regex);
|
var it = strmap.searchIterator(link.regex);
|
||||||
|
Reference in New Issue
Block a user