Sublime Forum

[BuildSystem] file_regex and symlinks

#1

Hi,

I just updated my build plugin to correctly parse errors in the console using file_regex. It works great!

Now i have just one little problem with the way it opens the file when it is a symlink.

Let say the error is this:

[ERROR] file:///Volumes/data/mguillon/Library/Developer/CoreSimulator/Devices/05A35754-62CB-4A09-A607-0806FD2731C8/data/Containers/Bundle/Application/B7CF9299-02EE-4386-AF6A-8C79CB6574DE/CarApp Opticies.app/lib/locationManager.js:135:40

The file is actually a symlink.
Sublime text opens the file correctly and if i modify it, the original files gets updated.
The problem is that Sublime Text shows the wrong path in the “Open Files” and title bar. Consequently i can the symlink file and original files opened at the same time. Also they keep on looking “unsync” and show me there are modifications for which i need to save.

It would be awesome if Sublime Text could first test for a symlink and actually open the original file.

Thanks

0 Likes

#2

Sublime does seem to have a few issues with symlinked files. Another example was recently reported on the issue tracker:

github.com/SublimeTextIssues/Core/issues/778

One should expect behaviour consistent with other OS utilities and programs, so for example if I create a symlink ~/fstab which symlinks to /etc/fstab, when opening ~/fstab Sublime should think it is editing ~/fstab even though it’s content is the linked file data (ie. /etc/fstab).

If the symlink and the underlying file are opened in two separate tabs, these should be treated as separate files. Though there is no sense or reason to do this, saving one tab would result in the other being marked dirty as if it had been “changed on disk” by another program.

I suggest reporting this on the issue tracker. It’d be nice to see Sublime’s handling of symlinked files tidied up.

0 Likes