sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

Ask infinite times to reload when a file changed too frequently

Open pdipietro opened this issue 2 years ago • 6 comments

Description of the bug

I have a shell script which run a loop on 20000 files to load a database. Loading each file requires 1 second. At every loaded files, 5 lines are added to. log files so, 100.000 lines are expected. If I have the file loaded on Sublime and don't scroll the file for sometime, Sublime start to ask 'File is changed. Do you want to reload' and if I respond Reload it ask again and again. It is like the first request to reload is for the first identified change, the a second then a third and so on.

There should be an option to reload the file in its latest version, discharging all the intermediate steps.

Steps to reproduce

1: open file.log on Sublime 2. create a shell script that add 5 lines to file.log every second 3: goto sublime and look at the first change scrolling down at the latest line 4: wait 10 minutes 5: go back to sublime and try to scroll to the bottom

Expected behavior

Sublime should only ask to reload the file at its latest version (that maybe will change in the while)

Actual behavior

Sublime seems to remember a lot of changes to the file and ask you to reload every 'version'

Sublime Text build number

4126

Operating system & version

MACOS 12.4

(Linux) Desktop environment and/or window manager

No response

Additional information

MACBook PRO with M1 processor

OpenGL context information

No response

pdipietro avatar Jun 04 '22 18:06 pdipietro

The dialog normally appears only, if an open file has unsaved changes, which would get lost in case of reloading content from disk.

deathaxe avatar Jun 05 '22 07:06 deathaxe

Yes, but if I accept to reload, the dialog reappears a lot of times, once for any given change on the stored file. So, the only way to effectively reload the file is to close it and then reload, but the script in background continues to produce more changes, so the play restarts again and again ....

pdipietro avatar Jun 08 '22 22:06 pdipietro

My point was it shouldn't ask at all in case log file hasn't been modified via ST before external scripts do so.

deathaxe avatar Jun 12 '22 07:06 deathaxe

I agree! So could we consider this as a bug?

pdipietro avatar Jun 12 '22 09:06 pdipietro

If "reload" button is hit once, all following filesystem updates shouldn't trigger confirmation update again until content is edited by user.

Maybe a race condition with hitting reload button vs. queued filesystem updates while dialog is open.

deathaxe avatar Jun 12 '22 10:06 deathaxe

Im seeing this aswell on windows 10. it only seems to trigger when ST comes into focus and if there were atleast 2 modifications to the file since ST was last in focus. "always_prompt_for_file_reload" is false so i wouldnt expect the dialog to trigger at all.

en-GB avatar Aug 10 '22 16:08 en-GB