sublimehq / sublime_text

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

New files not listed when created quickly from outside ST4 #4485

Open objarni opened 3 years ago

objarni commented 3 years ago

Description

Background: This was detected during generating from other code - migrating old C 89' style program to C99 - a Python script generated files in a subfolder of the repo, and the subfolder stayed empty except for 1 or 2 files when the expected number is around 20.

Bringing up the 'Open file' dialog is a workaround, this seems to force a refresh.

I expect ST to 'refresh' the FOLDERS view when files on disk change - possible not instantly, but at least within a second. Instead, sometimes, the FOLDERS view shows an 'old version' of the files list / tree.

Steps to reproduce

  1. Start Sublime Text

  2. Add a folder under Project menu

  3. Create a subfolder "tmp"

  4. Using an external terminal window, cd to the tmp folder

  5. In the terminal, create lots of files quickly, e.g

    ls /var/log | xargs touch $1

  6. With luck: notice the tmp/ FOLDER in ST4 does not update at all

  7. Workaround: press Ctrl+O (open), this forces a refresh of FOLDERS

Expected behavior

The FOLDER tmp/ should update within 1 s from that the terminal creates lots of files.

Actual behavior

Intermittent: the tmp/ folder is not refreshed in ST4.

Environment

objarni commented 3 years ago

I want to add that the subfolder was generated, so is ignored in .gitignore file of repo (visualized in ST with a slightly less destinct color).

objarni commented 3 years ago

Here is a demo of behaviour. https://www.youtube.com/watch?v=vIyInmLvPkM

The open files dialog workaround doesn't work anymore, so ignore step 7 i repro steps.

objarni commented 3 years ago

OK, I think I got it: folders that are gitignored do not auto-refresh. Is this intentional?

BenjaminSchaaf commented 3 years ago

OK, I think I got it: folders that are gitignored do not auto-refresh. Is this intentional?

gitignored folders are watched the same way as other folders. I have found a case where quickly recursively deleting a folder and then re-creating the same folder can lead to it not being watched. Is that what's happening here?

objarni commented 3 years ago

Hmm yes that might be the case, as the build script does just that 👍

BenjaminSchaaf commented 9 months ago

Are you still seeing this issue?