From fd11660c0a714852a3f477a6730d49b9694e1345 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Fri, 16 Dec 2016 23:12:44 -0800 Subject: [PATCH] Fix config reloading The main refactor broke config reloading; specifically, colors were not updating for subsequent draws. --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 409f1c93..18a7e322 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,7 +67,7 @@ fn main() { /// /// Creates a window, the terminal state, pty, I/O event loop, input processor, /// config change monitor, and runs the main display loop. -fn run(config: Config, options: cli::Options) -> Result<(), Box> { +fn run(mut config: Config, options: cli::Options) -> Result<(), Box> { // Create a display. // // The display manages a window and can draw the terminal @@ -133,9 +133,10 @@ fn run(config: Config, options: cli::Options) -> Result<(), Box> { // Handle config reloads let config_updated = config_monitor.as_ref() .and_then(|monitor| monitor.pending_config()) - .map(|config| { + .map(|new_config| { display.update_config(&config); processor.update_config(&config); + config = new_config; true }).unwrap_or(false);