Call dmon_unwatch when changing project

Fix a conspicuous omission to call the dmon_unwatch function
when changing project directory.

This uncovered a bug or a quirk of the dmon library where the watch_ids
can change as a result of calling dmon_unwatch because they are just
indexes on a contiguous array. Use a workaround to always unwatch the
first valid watch_id N times.
This commit is contained in:
Francesco Abbate
2021-12-20 14:42:48 +01:00
parent 29318be9c7
commit 3109263c5d
3 changed files with 28 additions and 1 deletions
+4 -1
View File
@@ -164,7 +164,10 @@ command.add(nil, {
core.error("Cannot open folder %q", text)
return
end
core.confirm_close_docs(core.docs, core.open_folder_project, text)
core.confirm_close_docs(core.docs, function(dirpath)
core.close_current_project()
core.open_folder_project(dirpath)
end, text)
end, suggest_directory)
end,