Sublime Forum

Bug in user settings, build 2027

#1

Summary:

A user set variable (in User/Base File.sublime-settings) is not properly assigned when starting.
It should be assigned to True but is set to False instead. Simply by saving the
settings file (which was left open from a previous session), the value gets assigned properly.

view.settings().get(“sublime_linter”)
False
Writing file /Users/andre/Library/Application Support/Sublime Text 2/Packages/User/Base File.sublime-settings with encoding UTF-8
reloading /Users/andre/Library/Application Support/Sublime Text 2/Packages/User/Base File.sublime-settings

view.settings().get(“sublime_linter”)
True

=====
Added information

Content of settings file

{
“color_scheme”: “Packages/Color Scheme - Default/Twilight_mod.tmTheme”,
“font”: “Monaco”,
“font_size”: 15,
“show_indent_guides”: true,
“translate_tabs_to_spaces”: true,
“sublime_linter”: true
}

Content of console

startup, version: 2027 osx x32 channel: stable
executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
working dir: /
packages path: /Users/andre/Library/Application Support/Sublime Text 2/Packages
settings path: /Users/andre/Library/Application Support/Sublime Text 2/Settings
error parsing session: No data at: 0:0
PackageSetup not required
catalogue loaded
found 1 files for base name Default.sublime-theme
found 2 files for base name Default (OSX).sublime-keymap
found 1 files for base name Main.sublime-menu
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/comment.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/copy_path.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/delete_word.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/detect_indentation.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/duplicate_line.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/exec.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/find_under_expand.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/font.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/goto_line.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/indentation.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/kill_ring.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/mark.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/scroll.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/sort.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/swap_line.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/switch_file.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/transform.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/transpose.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/indent_guides.py
Reloading plugin /Users/andre/Library/Application Support/Sublime Text 2/Packages/sublimelint/sublimelint_plugin.py
loading bindings
theme loaded
app ready
loaded 918 snippets

view.settings().get(“sublime_linter”)
False
Writing file /Users/andre/Library/Application Support/Sublime Text 2/Packages/User/Base File.sublime-settings with encoding UTF-8
reloading /Users/andre/Library/Application Support/Sublime Text 2/Packages/User/Base File.sublime-settings

view.settings().get(“sublime_linter”)
True

0 Likes

#2

I’m unable to replicate this. My steps:

  • Add a new, not used anywhere else, variable to User/Base File.sublime-settings.(“foo”: 1 in this case). Save.
  • Restart, via Hot Exit
  • Console:

view.settings().get(“foo”)
1.0

0 Likes

#3

[quote=“jps”]I’m unable to replicate this. My steps:

  • Add a new, not used anywhere else, variable to User/Base File.sublime-settings.(“foo”: 1 in this case). Save.
  • Restart, via Hot Exit
  • Console:

view.settings().get(“foo”)
1.0[/quote]

Ok, I just did the same

view.settings().get(“foo”)
1.0

view.settings().get(“sublime_linter”)
True
(changing view - to another file)

view.settings().get(“sublime_linter”)
False

I guess I misunderstand User File preferences and should perhaps add this to Global preferences.

0 Likes

#4

Keep in mind that settings can be overridden on a per-view basis: if you call view.settings().set(‘sublime_linter’, False), then that view will always return False (even over restarts), until it’s closed, irrespective of the value in User/Base File.sublime-settings.

Could it be that you’ve set the value on the view directly at some point? (if so, you can either close the view and reopen it, or call view.settings().erase(‘sublime_linter’), which will cause it to forget its own value, and use the default one).

0 Likes

#5

[quote=“jps”]Keep in mind that settings can be overridden on a per-view basis: if you call view.settings().set(‘sublime_linter’, False), then that view will always return False (even over restarts), until it’s closed, irrespective of the value in User/Base File.sublime-settings.

Could it be that you’ve set the value on the view directly at some point? (if so, you can either close the view and reopen it, or call view.settings().erase(‘sublime_linter’), which will cause it to forget its own value, and use the default one).[/quote]

I believe I might have done so, but I assumed it would have been forgotten when I quit the program (which I did a few times while experimenting). I will not be able to look into this for another 8 hours or so. Thanks for your help.

0 Likes