Skip to content

Commit

Permalink
Check for creation as well -- Write might not trigger on all systems
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRadev committed Feb 5, 2022
1 parent 7c1f2ee commit 4b6db85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ pub fn init_update_loop<S>(renderer: markdown::Renderer, mut ui_sender: S)

loop {
match watcher_receiver.recv() {
Ok(DebouncedEvent::Write(file)) => {
debug!("File updated: {}", file.display());
Ok(DebouncedEvent::Write(file) | DebouncedEvent::Create(file)) => {
debug!("File update/recreate detected: {}", file.display());

if file == renderer.canonical_md_path {
match renderer.run() {
Expand Down

0 comments on commit 4b6db85

Please sign in to comment.