Home Download Buy Blog Forum Support

Bug in user settings, build 2027

Bug in user settings, build 2027

Postby aroberge on Tue Feb 22, 2011 12:24 pm

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
aroberge
 
Posts: 21
Joined: Sat Feb 12, 2011 1:03 am

Re: Bug in user settings, build 2027

Postby jps on Tue Feb 22, 2011 12:55 pm

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
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Bug in user settings, build 2027

Postby aroberge on Tue Feb 22, 2011 1:21 pm

jps wrote: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


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.
aroberge
 
Posts: 21
Joined: Sat Feb 12, 2011 1:03 am

Re: Bug in user settings, build 2027

Postby jps on Tue Feb 22, 2011 1:47 pm

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).
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Bug in user settings, build 2027

Postby aroberge on Tue Feb 22, 2011 1:55 pm

jps wrote: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).


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.
aroberge
 
Posts: 21
Joined: Sat Feb 12, 2011 1:03 am


Return to Technical Support

Who is online

Users browsing this forum: qgates and 29 guests