Sublime Forum

Bug: Sublime holds lock on file even after file is saved and closed


My use-case for Sublime is as a secondary editor to Visual Studio. For C++ code I use Visual Studio exclusively. However, when I am editing documentation, README, CHANGELOG, or other non-C++ content it is more convenient to use sublime because I can browse files in directories added to the Folders pane. It is also convenient for browsing folders containing code that is not part of my project. For example other boost libraries. So I don’t make much use of the indexing features, since my primary needs for indexing are already satisfied by Intellisense (when it works).



3 days of fairly regular rebasing, and I haven’t seen this bug :slight_smile:



I reliable* get “Permission denied” errors on Windows when doing rebases. I tried to tackle this today with no luck. I get this with a vanilla Sublime install, and turning off the indexer doesn’t change anything, downgrading git did not help.

The only safe way is to quickly switch to another window (so Sublime is in the background), or by closing all files with changes.

I would say, basically the more files open affected by the rebase the more likely I get the error. Also the newer git versions (with the native, fast rebase implementation) are more likely to err. (But I downgraded git and could also reproduce easily.)

Sublime also slows down the rebasing, at least it is sweating on my (rather slow) laptop, with repainting and reloading the view and the various visual git badges. T.i. usually reloading a file in Sublime is almost instant, maybe the view flickers, but during a rebase it gets stuck at points and I clearly have some ms of a clear/unpainted view in between.

* I currently have a ~20 commits PR branch which (luckily for testing) fails more than 50% of the time.



I have setup a minimal repro repo

I thought timely tight writing and deleting the same file, which is probably the relevant thing a rebase does, could expose the “Permission denied” error, and it does so on my computer. You can find the instruction over there. (My computer is a standard Windows 10 install, all patches included, no hacks, Windows Defender on of course. I used the current vanilla portable Sublime from your website, downloaded ten minutes ago.)