aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/index.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2021-12-23 10:23:06 +0000
committerGitHub <noreply@github.com>2021-12-23 12:23:06 +0200
commit3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1 (patch)
treed2e8132a7b0acfc6f44c7f8e4ca0d7f5f78a5432 /alacritty_terminal/src/index.rs
parent6d1a63ef28d18168ed4ca0d6a8c3413cb4621ca5 (diff)
downloadalacritty-3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1.tar.gz
alacritty-3af1940192245f96f0b7c8e2d2d5c4a5d8eb98a1.zip
Fix CreateNewWindow CLI fallback
The existing behavior for the new CreateNewWindow actions was to always pass in their own options, which would discard the existing options configured on the terminal's PTY config. To fix this the behavior for CreateNewWindow is now the same as for the initial window creation, the config values are overwritten conditionally based on their individual presence in the CLI options. However all temporary CLI options set on the "master" Alacritty instance are discarded by all future windows. Fixes #5659.
Diffstat (limited to 'alacritty_terminal/src/index.rs')
-rw-r--r--alacritty_terminal/src/index.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/alacritty_terminal/src/index.rs b/alacritty_terminal/src/index.rs
index 29b3eb15..e672c752 100644
--- a/alacritty_terminal/src/index.rs
+++ b/alacritty_terminal/src/index.rs
@@ -20,6 +20,7 @@ pub enum Direction {
}
impl Direction {
+ #[must_use]
pub fn opposite(self) -> Self {
match self {
Side::Right => Side::Left,
@@ -133,6 +134,7 @@ pub struct Line(pub i32);
impl Line {
/// Clamp a line to a grid boundary.
+ #[must_use]
pub fn grid_clamp<D: Dimensions>(self, dimensions: &D, boundary: Boundary) -> Self {
match boundary {
Boundary::Cursor => max(Line(0), min(dimensions.bottommost_line(), self)),