diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-08-22 20:55:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 20:55:27 +0000 |
commit | 6cfcd7c25930d0478bc35731543e37a2e0c8f13f (patch) | |
tree | c4ded7fbb33774d915d6a25048d8a523cfd57c34 /alacritty/src/event.rs | |
parent | 92a3d482d076eebbd12681444ae8f4dfdf08da69 (diff) | |
download | r-alacritty-6cfcd7c25930d0478bc35731543e37a2e0c8f13f.tar.gz r-alacritty-6cfcd7c25930d0478bc35731543e37a2e0c8f13f.tar.bz2 r-alacritty-6cfcd7c25930d0478bc35731543e37a2e0c8f13f.zip |
Add CLI parameter to override config options
This uses the facilities added in
3c3e6870dedad56b270f5b65ea57d5a6e46b1de6 to allow overriding individual
configuration file options dynamically from the CLI using the
--options/-o parameter.
Fixes #1258.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r-- | alacritty/src/event.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index d0ce3601..c3e1b6c8 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -39,7 +39,7 @@ use alacritty_terminal::term::{ClipboardType, SizeInfo, Term, TermMode}; #[cfg(not(windows))] use alacritty_terminal::tty; -use crate::cli::Options; +use crate::cli::Options as CLIOptions; use crate::clipboard::Clipboard; use crate::config; use crate::config::Config; @@ -139,6 +139,7 @@ pub struct ActionContext<'a, N, T> { pub urls: &'a Urls, pub scheduler: &'a mut Scheduler, pub search_state: &'a mut SearchState, + cli_options: &'a CLIOptions, font_size: &'a mut Size, } @@ -693,6 +694,7 @@ pub struct Processor<N> { font_size: Size, event_queue: Vec<GlutinEvent<'static, Event>>, search_state: SearchState, + cli_options: CLIOptions, } impl<N: Notify + OnResize> Processor<N> { @@ -704,6 +706,7 @@ impl<N: Notify + OnResize> Processor<N> { message_buffer: MessageBuffer, config: Config, display: Display, + cli_options: CLIOptions, ) -> Processor<N> { #[cfg(not(any(target_os = "macos", windows)))] let clipboard = Clipboard::new(display.window.wayland_display()); @@ -723,6 +726,7 @@ impl<N: Notify + OnResize> Processor<N> { event_queue: Vec::new(), clipboard, search_state: SearchState::new(), + cli_options, } } @@ -826,6 +830,7 @@ impl<N: Notify + OnResize> Processor<N> { urls: &self.display.urls, scheduler: &mut scheduler, search_state: &mut self.search_state, + cli_options: &self.cli_options, event_loop, }; let mut processor = input::Processor::new(context, &self.display.highlighted_url); @@ -1051,14 +1056,11 @@ impl<N: Notify + OnResize> Processor<N> { processor.ctx.display_update_pending.dirty = true; } - let config = match config::load_from(&path) { + let config = match config::reload(&path, &processor.ctx.cli_options) { Ok(config) => config, Err(_) => return, }; - let options = Options::new(); - let config = options.into_config(config); - processor.ctx.terminal.update_config(&config); // Reload cursor if we've changed its thickness. |