Sublime Forum

Listen to file-tree changes (new, move, removal of files and directories)

#1

In Sublime Text’s sidebar, the current opened folder(s) are shown. Is there any way to listen to the event that a file-tree change was just applied in the opened folder(s)?

For example,

- dir1
   - file11
   - file12
- dir2
   - file21

Is there any way for sublime_plugin to receive notification that file12 was just removed, or that dir2 was just renamed? Note that the modification of contents of file12 itself does not qualify for such events. Only New or Remove or Move (Rename) will qualify.

If a detailed notification ("file12 was just removed") does not exist, a general notification (“a file-tree change just happened”) is also good.

Thanks!

1 Like

#2

No, there isn’t any API to listen for filesystem changes.

0 Likes

#3

I created a personal plugin that hooks up with LSP-chokidar and notifies my other plugins with file/dir changes

0 Likes