diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-10-27 14:15:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-27 14:15:08 +0000 |
commit | a9397727d2a0d07a0a3aeed83a21e44c638677ef (patch) | |
tree | 4cc44025abadda8aa978a0995067458b21737261 /src/input.rs | |
parent | e5ca26518ec0b520cecd1a53076ddec589f14248 (diff) | |
download | alacritty-a9397727d2a0d07a0a3aeed83a21e44c638677ef.tar.gz alacritty-a9397727d2a0d07a0a3aeed83a21e44c638677ef.zip |
Relax matching of URL modifiers
To click on links in the alternate screen buffer, it is necessary that
the `shift` button is held down, otherwise mouse events are captured by
the application. However this would also require that `Shift` is added
to the `mouse.url.modifiers` option. Thus it is not possible anymore to
click on URLs unless the shift button is always held down.
To resolve this issue, the matching of modifiers has been relaxed. If a
modifier is specified in the config, it is always required to be held
down. However if a modifier is held down which is not specified, it is
still accpeted. This one-way relaxed matching allows clicking on links
with or without shift held down without having to make use of the
`mouse.url.modifiers` setting at all.
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs index 49a9101e..b705fd19 100644 --- a/src/input.rs +++ b/src/input.rs @@ -520,7 +520,9 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { // Spawn URL launcher when clicking on URLs fn launch_url(&self, modifiers: ModifiersState) -> Option<()> { - if modifiers != self.mouse_config.url.modifiers || self.ctx.mouse().block_url_launcher { + if !self.mouse_config.url.mods_match_relaxed(modifiers) + || self.ctx.mouse().block_url_launcher + { return None; } |