sublimehq / sublime_text

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

File modification tracking within symlinked packages #3089

Open deathaxe opened 4 years ago

deathaxe commented 4 years ago

Description

File modification tracking seems partly broken and/or delayed for symlinked packages, which point to an external git repository.

The issue was realized while working on the CSS package, which is a junction to an external repository at C:\Data\Sublime\Default Packages.

Steps to reproduce

  1. Create a junction "CSS" within Data/Packages which points to an external folder (e.g.: C:\Data\Sublime\Default Packages\CSS
  2. Add the Data/Packages folder to the sidebar of ST.
  3. Open a file (e.g.: CSS\css_completions.py)
  4. Edit the file and save it.
  5. Open Sublime Merge and commit the changes
  6. Return to ST and see the file still being marked as modified in the sidebar and minidiff
  7. Hit ctrl+s to save the file again -> badge in the sidebar disapears, minidiff stays.

Expected behavior

The minidiff should not show any modifications after the file was committed.

Actual behavior

The sidebar and minidiff still show the modified state as if the file was not committed.

grafik

After saving the file once more, the badge in the sidebar disapears but the minidiff still shows the modified state .

grafik

Environment

wbond commented 4 years ago

I don't believe we've touched anything here, so I tend to think it isn't really a regression.

deathaxe commented 4 years ago

Indeed, no regression - or only partly at least.

Minidiff

The minidiff doesn't update after committing a file in ST3122 as well (if GitGutter is disabled). That's the reason, I never realized it. GitGutter sets the reference document if the commit hash changed and a view is activated. Therefore the minidiff is updated correctly, if GitGutter is enabled. Now that I disabled GitGutter with ST4053, the issue reveals.

Sidebar Badges

But the delayed update of the sidebar is new in ST4053. The badge is updated only if the folder is collapsed and expanded again or the file is saved.

Doing the vice versa thing ....

  1. modify a file
  2. save it -> badges not updated
  3. collapse and reopen folder -> badge updated
  4. undo changes in the file
  5. save it -> badges not updated
  6. collapse and reopen folder -> badge updated

Animation

Same happens after committing file and resetting branch in the background. The badges update immediatelly in ST3211 but not in 4053.

Note: I think there is a related issue pending about sidebar badges not to update sometimes, but I can't find it atm.

deathaxe commented 4 years ago

The same sequence with a ST4053 vanilla install doesn't show the sidebar badge at all.

Animation

wbond commented 4 years ago

Ok, thanks for pointing that out!