Sublime Forum

[Bug] Build 3117 Settings - Syntax Specific Incorrect File Path

#1

On Windows, when opening PREFERENCES / SETTINGS - SYNTAX SPECIFIC Sublime Text Build 3117 always creates an empty new default template for the syntax.sublime-settings file, even when there is an existing file. The file path in the tab appears to be correct, however upon attempting to save the file the following error appears:

“Unable to save D:\Users_username_\Dropbox\Documents\C:\Users_username_\AppData\Roaming\Sublime Text 3\Packages\User\Plain text.sublime-settings
Error: The filename, directory name, or volume label syntax is incorrect.”

Note the concatenation of the two file paths. The first path seems to be the path to the current project. The second path is the correct path to the syntax settings file.

Selecting SAVE AS and manually navigating to the save path functions as expected. The fact that a blank file is initially created, however, creates the danger of saving over existing settings.

1 Like

Bug: can't load/save .sublime-settings from User dir linked via directory junction (Windows)
#2

I confirm report from DAScott, for me on Windows 7 x64
When open a syntax file, the file is blank, it’s a new file.
When save the file, the path is wrong (concatenation of two file paths) and therefore Sublime fails to save file.

0 Likes

#3

Seems like this is a bug in the open_file command:

>>> window.run_command('open_file', {'file': r"C:\Users\Fichte\AppData\Roaming\Sublime Text 3\Packages\User\Python.sublime-settings", 'contents': "test"})
Unable to open /C/Users/Fichte/AppData/Roaming/Sublime Text 3/Packages/Default/C:\Users\Fichte\AppData\Roaming\Sublime Text 3\Packages\User\Python.sublime-settings

The first part of the path is the folder the current view resides in, so os.path.dirname(view.file_name()).

Since it works with the parameter 'res://Packages/Default/Preferences.sublime-settings', this is most likely an error in expecting the parameter to be in the internal representation when it’s not for windows paths.

That aside, imo the “open settings” command should use the res:// protocol for both files, the default and user file.

Edit: res:// doesn’t work either. I filled a more detailed report at https://github.com/SublimeTextIssues/Core/issues/1260.

2 Likes

#4

Thank you for confirming e502! Was beginning to think it was just me.

Thanks for researching and submitting the bug FichteFoll! Will be nice to have it working correctly.

0 Likes

#5

looks like this has been fixed now, seems to work for me in 3119

1 Like

#6

Agreed, working for me as well. Kudos to the developers for fixing the issue.

0 Likes