summaryrefslogtreecommitdiff
path: root/src/main/main.c
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-08-14 21:34:38 +0200
committerAlbert Cervin <albert@acervin.com>2024-08-14 21:34:38 +0200
commit8f456ac19e5e80eaa911645f882d184a534f87a4 (patch)
tree087ce06ec00fd8d7290f1c3d900a25c4af478d6a /src/main/main.c
parent0849b6fa3ff76fb780b7ffd353d63c77c20e63e2 (diff)
downloaddged-8f456ac19e5e80eaa911645f882d184a534f87a4.tar.gz
dged-8f456ac19e5e80eaa911645f882d184a534f87a4.tar.xz
dged-8f456ac19e5e80eaa911645f882d184a534f87a4.zip
Do not reload buffer if it could not be watched
Previously it tried to reload the buffer even though it could not be watched.
Diffstat (limited to 'src/main/main.c')
-rw-r--r--src/main/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/main.c b/src/main/main.c
index ee954f9..8e3e862 100644
--- a/src/main/main.c
+++ b/src/main/main.c
@@ -125,7 +125,10 @@ void update_file_watches(struct reactor *reactor) {
message("re-watching: %s", w->buffer->filename);
w->watch_id =
reactor_watch_file(reactor, w->buffer->filename, FileWritten);
- reload_buffer(w->buffer);
+
+ if (w->watch_id != INVALID_WATCH) {
+ reload_buffer(w->buffer);
+ }
}
}
}