Removed boolean logic, reverted back to ctrlOrSuper call

This commit is contained in:
Alex
2025-07-12 09:29:03 -07:00
parent 1e88984709
commit a19f4aea0a

View File

@ -3676,17 +3676,18 @@ 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| { .always_mods, .hover_mods => |v| if (!v.equal(mouse_mods)) continue,
// Special case: if the expected mods are "ctrl or super" (like the default URL config), // .always_mods, .hover_mods => |_| {
// then we should match if the user pressed either ctrl or super, just like OSC8 links. // // Special case: if the expected mods are "ctrl or super" (like the default URL config),
const is_ctrl_or_super_expected = (v.ctrl and !v.super and !v.shift and !v.alt) or // // then we should match if the user pressed either ctrl or super, just like OSC8 links.
(v.super and !v.ctrl and !v.shift and !v.alt); // // const is_ctrl_or_super_expected = (v.ctrl and !v.super and !v.shift and !v.alt) or
if (is_ctrl_or_super_expected) { // // (v.super and !v.ctrl and !v.shift and !v.alt);
if (!(mouse_mods.ctrl or mouse_mods.super)) continue; // // if (is_ctrl_or_super_expected) {
} else { // // if (!(mouse_mods.ctrl or mouse_mods.super)) continue;
if (!v.equal(mouse_mods)) continue; // // } else {
} // // if (!v.equal(mouse_mods)) continue;
}, // // }
// },
} }
var it = strmap.searchIterator(link.regex); var it = strmap.searchIterator(link.regex);