Sublime Forum

Option: ST should not resolve a symlinked project file

#1

Hello,

At first, ST3 is great. Thanks :slight_smile:

I wrote a generic .sublime-project file. I only need to copy it to a directory, and it works with relative folder paths, like “…/…”, and ${project_path}, etc.
I can make hard links to the project file into other directories, they will work as I expect. :slightly_smiling:
It is good, because I can change the generic project file and all of my repositories’ project files (.sublime-project) will be refreshed automatically. (because they are identical(=they are hard links))

Recently I thought, it would be nice if I could just sync this project file through computers.
So I only need to sync one hard-linked project file somehow with another device, and make hard links there too. Peace of cake?! No, sadly. Because most of the cloud based file sharing clients actually delete the original file, and move a new there with the same name when sync a file, and this broke the hard links. It is understandable working. Nobody wants unnecessary I/Os. I thought I sync the original file, and place symlinks into my project directories. It will do the sync and on windows if I open a symlinked project file it works as intended,

for example:

("folders": [ { "path": "../.." } ])...

(c:\repo\source1\ST3\project<symlinked1>.sublime-project <—> c:\syncdir\dir1\dir2\original1.sublime-project)
and
(/Volume/v1/repo/source1/ST3/project/.sublime-project <—> /Volume/v1/syncdir/dir1/dir2/original1.sublime-project)


it can find files in path “…/…” = “c:\repo\source1” :sunny:

On the other hand, on OSX, - if I use symlinks just like on windows, - and open the symlinked project file, it will find files in path “…/…” = “/Volumes/v1/syncdir”, which is not good. :disappointed:

If I am correct, it would solve my problem, if sublime won’t resolve the location of the project file on OSX (on Unix like OSs?)
(It could be an option? A in the general settings or in the project file maybe?)
Do you have any other suggestion?

Thanks for Your attention :slightly_smiling:

0 Likes

#2

There’s a project setting called follow_symlinks which can be set to true or false: https://www.sublimetext.com/docs/3/projects.html

0 Likes

#3

I corrected my question, please reread it.
I familiar with this option, but it is about how symlinks handled in “folders”.
My problem is different. In my case the project file is a symlink, and when sublime resolve relative paths in “folders” - example: "folders": [ { "path": "../.." } ] - it will realtive to the resolved original file path, not the path of the symlink.

0 Likes

#4

Ah, sorry - I misunderstood.

0 Likes