diff options
author | Christian Duerr <contact@christianduerr.com> | 2023-11-08 05:19:11 +0100 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2023-11-11 20:33:06 +0100 |
commit | 683b5a2cb47579560ed272dc1a4818507dbd30c7 (patch) | |
tree | 226abbead70795e53b4c9162cb30609d7a1210af /alacritty/src/event.rs | |
parent | 4a2666706062934c4830e73672e78fcde3210310 (diff) | |
download | r-alacritty-683b5a2cb47579560ed272dc1a4818507dbd30c7.tar.gz r-alacritty-683b5a2cb47579560ed272dc1a4818507dbd30c7.tar.bz2 r-alacritty-683b5a2cb47579560ed272dc1a4818507dbd30c7.zip |
Unify CLI config override mechanisms
This patch changes the way the `-o` config option works when specified
at startup to function the same way as the IPC mechanism.
While this should technically perform the exact same way, it should
hopefully make it a little easier to understand how CLI config
replacement works.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r-- | alacritty/src/event.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 3dc1a262..3bd24f89 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -479,7 +479,7 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon #[inline] fn start_search(&mut self, direction: Direction) { // Only create new history entry if the previous regex wasn't empty. - if self.search_state.history.get(0).map_or(true, |regex| !regex.is_empty()) { + if self.search_state.history.front().map_or(true, |regex| !regex.is_empty()) { self.search_state.history.push_front(String::new()); self.search_state.history.truncate(MAX_SEARCH_HISTORY_SIZE); } @@ -1539,8 +1539,7 @@ impl Processor { #[cfg(unix)] { let options = self.global_ipc_options.clone(); - let ipc_config = IpcConfig { options, window_id: None, reset: false }; - window_context.update_ipc_config(self.config.clone(), ipc_config); + window_context.add_window_config(self.config.clone(), &options); } self.windows.insert(window_context.id(), window_context); @@ -1741,7 +1740,12 @@ impl Processor { .iter_mut() .filter(|(id, _)| window_id.is_none() || window_id == Some(**id)) { - window_context.update_ipc_config(self.config.clone(), ipc_config.clone()); + if ipc_config.reset { + window_context.reset_window_config(self.config.clone()); + } else { + window_context + .add_window_config(self.config.clone(), &ipc_config.options); + } } }, // Create a new terminal window. |