Sublime Forum

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

#21

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).

2 Likes

#22

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

3 Likes

#23

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.

0 Likes

#24

I have setup a minimal repro repo https://github.com/kaste/PermissionDeniedTest

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.)

0 Likes

#25

I’m encountering the same or a very similar issue. Tested with both Build 4200, as well as Build 4192 which I was still using until I updated to check if the issue had been fixed. It happens intermittently, not for every file, but very commonly.

I open a text file then close it. Then I try to rename the directory containing the modified file. Windows explorer gives an error, “The action can’t be completed because the folder or a file in it is open in another program.”. The error is resolved by closing Sublime Text and trying to rename the directory again. Sometimes I modify and save the file before closing it, sometimes not. Sometimes I open multiple files at once (selecting multiple in the file explorer and pressing enter), sometimes one. There isn’t a clear pattern or common factor for what files this happens with and which it doesn’t, but it does seem to consistently happen or not happen for the same files on repeated attempts.

0 Likes