aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-10-16 18:38:57 -0700
committerJoe Wilm <joe@jwilm.com>2017-10-16 18:38:57 -0700
commitd3151dfbf99e64fd5855d0e0ce5be119410ba293 (patch)
treed8acc78e76c839a1847c897b2bae919f59931de4
parent1cf9a179bcad16e4a314b595cb8a7797ba3098a0 (diff)
downloadalacritty-d3151dfbf99e64fd5855d0e0ce5be119410ba293.tar.gz
alacritty-d3151dfbf99e64fd5855d0e0ce5be119410ba293.zip
Fix config reloading
Must have been broken when upgrading notify-rs
-rw-r--r--src/config.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs
index 605a80db..eacb1c7e 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1454,12 +1454,16 @@ impl Monitor {
let config_path = ::std::fs::canonicalize(path)
.expect("canonicalize config path");
- watcher.watch(&config_path, RecursiveMode::NonRecursive).expect("watch alacritty yml");
+ // Get directory of config
+ let mut parent = config_path.clone();
+ parent.pop();
- loop {
- let event = rx.recv().expect("watcher event");
+ // Watch directory
+ watcher.watch(&parent, RecursiveMode::NonRecursive)
+ .expect("watch alacritty.yml dir");
- match event {
+ loop {
+ match rx.recv().expect("watcher event") {
DebouncedEvent::Rename(_, _) => continue,
DebouncedEvent::Write(path) | DebouncedEvent::Create(path)
| DebouncedEvent::Chmod(path) => {