jp (blog/preview): fixed watch restoring when file is moved/deleted:

with some editors (e.g. vim), when file is written it is actually replaced with a buffered
one. In this case, jp replace the watch to check the new file, but it was not working
anymore with latest version of inotify module. This patch fixes it by removing the old watch
before adding a new one.
This commit is contained in:
Goffi 2019-07-12 11:29:05 +02:00
commit fb58a375f8

View file

@ -801,6 +801,7 @@ class Preview(base.CommandBase, common.BaseEdit):
),
2,
)
i.remove_watch(self.content_file_path)
try:
add_watch()
except InotifyError: