TheSpyder / SyncedSideBar

Sublime Text plugin to sync project sidebar (folder view) with currently active file.
341 stars 23 forks source link

Avoid crash when editing Git commit message in Sublime Text < 4148 #62

Closed blimpage closed 1 year ago

blimpage commented 1 year ago

Fixes #61

Selecting "Reveal in Side Bar" when editing a file inside a .git/ directory crashes some versions of Sublime Text. This was fixed in Sublime Text 4148: https://github.com/sublimehq/sublime_text/issues/5881

Since SyncedSideBar automatically calls "Reveal in Side Bar", Sublime Text will instantly crash when e.g. editing a Git commit message while running SyncedSideBar. This pull request introduces a workaround for the issue, skipping revealing Git files in the sidebar in versions of Sublime Text prior to 4148.

I'm not sure which version of Sublime Text introduced the crash, so I haven't added a lower version to the check. This means that SyncedSideBar won't reveal files under .git/ in older versions of Sublime Text, even if there's no risk of a crash in those versions. This shouldn't be an issue for most users since Sublime Text doesn't display .git/ directories in the side bar by default, but may cause unexpected behaviour for some users.

TheSpyder commented 1 year ago

Looks fine, thank you! I'm happy to have it exclude showing any .git folder files on older versions for now. If there's a regression report I can always add a lower bounds later.

blimpage commented 1 year ago

Awesome, thank you!