hello @OdatNurd,
Thank you for your reply. I can recreate this behavior based on your description on Linux. However, it still happens sometimes (on Linux) that ALL relative paths are recreated as absolute, even if thereās a common ancestor.
This is very smart of ST. However, as a feature request, (and without knowing the nitty gritty details under the hood) I would suggest that the evaluation to swap should not perform on existing paths.
Since I am aware of this limitation I successfully applied your suggested workarounds for many years now. In very rare cases I change this by accident.
On Windows it is not behaving as you describe:
Test environment:
OS: Windows 8.1
ST3, Build 3143, Build 3176
Observation
ST3 recreates project paths as absolute / relative based on its own criteria.
Paths that are of one type can be changed into another. These changes are not
persistent, however.
Consider the following project (testcase 1):
{
"folders":
[
{
"path": "../../../Project"
},
{
"path": "../../../Project/doc"
},
{
"path": "../../../utils"
}
]
}
The paths had been manually defined. These MUST remain relative in order to
use them on multiple platforms / root directories.
Now, add a new folder to the project, āsrcā:
- Project -> Add Folder to Projectā¦
- navigate to ā¦/ā¦/ā¦/Project/src
- press Ok
The folder paths result in the following:
{
"folders":
[
{
"path": "C:\\test\\testcase\\Project"
},
{
"path": "C:\\test\\testcase\\Project\\doc"
},
{
"path": "C:\\test\\testcase\\utils"
},
{
"path": "C:\\test\\testcase\\Project\\src"
}
]
}
ST3 only creates relative paths if sample.sublime-project is the root directory (consider testcase 2 in Attachments).
It would be nice if ST3 preserves paths as relative that are 2 or even 1 level below ``${project_path}.
Attachment