sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
809 stars 39 forks source link

Detect externally modified files and offer to reload or retain changes. #3139

Open ht990332 opened 4 years ago

ht990332 commented 4 years ago

Let's say I am modifying a text file and another application changes something and saves them to disk. Sublime can use inotify on Linux and whatever API Windows for monitoring file changes to detect the file changed on disk and offer to reload the updated file or retain changes.

Some other file editors such as gedit have this capability and it would be nice if Sublime could too.

jfcherng commented 4 years ago

I think ST has been behaved (or at least designed) like that all the time.

ht990332 commented 4 years ago

It is definitely not behaving like that here.

jfcherng commented 4 years ago

Remote filesystem used?

ht990332 commented 4 years ago

Local file system. /home/hussam/Documents

deathaxe commented 4 years ago

Any output in the console? Maybe ST just failed to create inotify objects due to system limitations? Depending on the amount of files and directories, ST needs to register quite many inotify objects, which can easily hit the system limits.

You can query the inotify limit via cat /proc/sys/fs/inotify/max_user_watches

You may try to increase the limit and see if it helps.

ht990332 commented 4 years ago

cat /proc/sys/fs/inotify/max_user_watches 524288 That should be high enough?

deathaxe commented 4 years ago

Yes.

deathaxe commented 4 years ago

Maybe the OS name and version as well as the used filesystem and ST version might help the core devs to look into it.

Do you have the mensioned folder added to the sidebar or just opened a single file from that path?

Does reloading work for files which are not located in the home directory?

ST heavily relies on filesystem notifications, thus the expected behavior is to reload externally modified files. Depending on the state you should optionally see a dialog to confirm reloading.

ht990332 commented 4 years ago

I simply open single files from that path. For example, "Reminders.txt", "Notes.txt", etc...

ht990332 commented 4 years ago

I am using Arch Linux with the official packaging using https://download.sublimetext.com/arch/stable/x86_64 The filesystem is ext4. Linux kernel version is 5.4.1 (I will be sticking to 5.4 kernel for a year or so).

It is not working in files outside my home directory as well. I tried in /var/tmp (also ext4 and not a separate partition).

BenjaminSchaaf commented 4 years ago

Which version of Sublime Text are you using? Just to confirm, there's nothing in the console?