aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
authorSonu Bardai <67749330+SonuBardai@users.noreply.github.com>2023-06-15 05:33:38 +0530
committerGitHub <noreply@github.com>2023-06-15 00:03:38 +0000
commitbe03effdbe5b5bdabfed50d87963e78017329182 (patch)
tree2c93c11ff37af3024d4540e4e9adcf7ce2c44aa6 /alacritty/src
parentcad0cbeca6f1b749681db244eb4472fe7ed9146d (diff)
downloadr-alacritty-be03effdbe5b5bdabfed50d87963e78017329182.tar.gz
r-alacritty-be03effdbe5b5bdabfed50d87963e78017329182.tar.bz2
r-alacritty-be03effdbe5b5bdabfed50d87963e78017329182.zip
Add option to persist hints after selection
Closes #6976.
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/config/ui_config.rs5
-rw-r--r--alacritty/src/display/hint.rs7
2 files changed, 11 insertions, 1 deletions
diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs
index ce236441..c4a1c83d 100644
--- a/alacritty/src/config/ui_config.rs
+++ b/alacritty/src/config/ui_config.rs
@@ -274,6 +274,7 @@ impl Default for Hints {
enabled: vec![Hint {
content,
action,
+ persist: false,
post_processing: true,
mouse: Some(HintMouse { enabled: true, mods: Default::default() }),
binding: Some(HintBinding {
@@ -366,6 +367,10 @@ pub struct Hint {
#[serde(default)]
pub post_processing: bool,
+ /// Persist hints after selection.
+ #[serde(default)]
+ pub persist: bool,
+
/// Hint mouse highlighting.
pub mouse: Option<HintMouse>,
diff --git a/alacritty/src/display/hint.rs b/alacritty/src/display/hint.rs
index c30a88c5..0ff070ec 100644
--- a/alacritty/src/display/hint.rs
+++ b/alacritty/src/display/hint.rs
@@ -150,7 +150,12 @@ impl HintState {
let bounds = self.matches[index].clone();
let action = hint.action.clone();
- self.stop();
+ // Exit hint mode unless it requires explicit dismissal.
+ if hint.persist {
+ self.keys.clear();
+ } else {
+ self.stop();
+ }
// Hyperlinks take precedence over regex matches.
let hyperlink = term.grid()[*bounds.start()].hyperlink();