From d97996e19de6856c23c51d05ec10f10db41e309d Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Tue, 15 Nov 2016 09:38:50 -0800 Subject: Make bindings configurable from alacritty.yml Bindings were previously hardcoded within input.rs; adding, removing, or changing a binding required a recompile! Now, bindings may be declared in alacritty.yml. Even better, bindings are live-reloaded when alacritty.yml is changed! One unexpected benefit of this change was that all of the special casing in input.rs has disappeared. Conversely, config.rs has gained complexity for all of the deserialization logic. Resolves #3. --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 38ecde39..ad8cfed9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -233,7 +233,8 @@ fn main() { let mut processor = event::Processor::new( input::LoopNotifier(loop_tx), terminal.clone(), - tx + tx, + &config ); let (config_tx, config_rx) = mpsc::channel(); @@ -253,6 +254,7 @@ fn main() { if let Ok(config) = config_rx.try_recv() { display.update_config(&config); + processor.update_config(&config); } // Maybe draw the terminal -- cgit