diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-11-13 05:40:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 08:40:09 +0300 |
commit | 9a7844987693909925b8663d8aa905231d291410 (patch) | |
tree | e99b99bcbd0fc40aa1938fc203357321ec024777 /alacritty_terminal/src/config | |
parent | b6d94e7b13eb9a14edea843a79c6d86b5b6d8803 (diff) | |
download | alacritty-9a7844987693909925b8663d8aa905231d291410.tar.gz alacritty-9a7844987693909925b8663d8aa905231d291410.zip |
Add ability to select text during search
This removes the restriction of not being able to select text while the
search is active, making it a bit less jarring of a UX when the user
tries to interact with the terminal during search.
Since the selection was used during vi-less search to highlight the
focused match, there is now an option for a focused match color, which
uses the inverted normal match color by default. This focused match is
used for both search modes.
Other mouse interactions are now also possible during search, like
opening URLs or clicking inside of mouse mode applications.
Diffstat (limited to 'alacritty_terminal/src/config')
-rw-r--r-- | alacritty_terminal/src/config/colors.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/alacritty_terminal/src/config/colors.rs b/alacritty_terminal/src/config/colors.rs index 13a30bef..a292fde4 100644 --- a/alacritty_terminal/src/config/colors.rs +++ b/alacritty_terminal/src/config/colors.rs @@ -15,7 +15,7 @@ pub struct Colors { #[serde(deserialize_with = "failure_default")] pub vi_mode_cursor: CursorColors, #[serde(deserialize_with = "failure_default")] - pub selection: SelectionColors, + pub selection: InvertedCellColors, #[serde(deserialize_with = "failure_default")] normal: NormalColors, #[serde(deserialize_with = "failure_default")] @@ -124,16 +124,16 @@ impl CursorColors { #[serde(default)] #[derive(Deserialize, Debug, Copy, Clone, Default, PartialEq, Eq)] -pub struct SelectionColors { - #[serde(deserialize_with = "failure_default")] - text: DefaultBackgroundCellRgb, +pub struct InvertedCellColors { + #[serde(deserialize_with = "failure_default", alias = "text")] + foreground: DefaultBackgroundCellRgb, #[serde(deserialize_with = "failure_default")] background: DefaultForegroundCellRgb, } -impl SelectionColors { - pub fn text(self) -> CellRgb { - self.text.0 +impl InvertedCellColors { + pub fn foreground(self) -> CellRgb { + self.foreground.0 } pub fn background(self) -> CellRgb { @@ -147,6 +147,8 @@ pub struct SearchColors { #[serde(deserialize_with = "failure_default")] pub matches: MatchColors, #[serde(deserialize_with = "failure_default")] + pub focused_match: InvertedCellColors, + #[serde(deserialize_with = "failure_default")] bar: BarColors, } |