Settings-view: Cannot override scoped settings when it matches the unscoped setting

Created on 19 Apr 2017  Â·  11Comments  Â·  Source: atom/settings-view


Please note: this has been duplicated to the atom-settings thread upon request by moderators in the language-python thread here

Prerequisites

Description

Python automatically indents 4 spaces when set to indent to 2 in the language-python settings and the editor settings.

Steps to Reproduce

  1. Clear the python section in the atom config
  2. Set indentation to 2 in the editor settings and the language-python settings (should say Unscoped Value: 2)
  3. Open up a python file and hit the tab key

Expected behavior: Tabs to 2 spaces

Actual behavior: Tabs to 4 spaces

Reproduces how often: On every install of Atom; for me probably about 5 different machines 100% of the time.

Versions

Atom : 1.13.1
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0

apm 1.14.1
npm 3.10.5
node 4.4.5
python 2.7.6
git 1.9.1

OS: Ubuntu 16.04, Ubuntu 14.04, Windows 8.1

Additional Information

It was possible to manually fix by entering the config file and adding the line tabLength: "2" under python, since just tabLength: 2 will automatically be deleted by the editor. (this no longer works)

bug

Most helpful comment

You could try adding the following to your config in accordance with https://github.com/atom/language-python/issues/183#issuecomment-295388166 This sould help while the issue is resolved.

".python.source":
  editor:
    tabLength: 2

All 11 comments

Can you link to the original thread? Settings-view is only for the display and editing of the settings. I'm confused as to how the bug would be in this package.

I've linked it at the top. I was told to make my issue here rather than on the atom/language-python issue page

So the problem is as follows:

  • The default indentation setting is 2
  • The default _scoped_ indentation setting for language-python is 4
  • Attempting to set the scoped indentation setting for language-python to 2 does not work and resets to 4

Ah right, now that makes a lot more sense - it's not python or even tab specific - just how we deal with defaults and scoped settings.

yes sorry, i wasnt at my PC so i just copied the post across.

@damieng So, will and when this philosophically huge BUG be solved? It's accidently damaged the love of Atom for its openness and flexibility.

@wanghailei the joy of open source is that anyone can fix it! Right now however nobody is.

We do have similar issues in language-rust: zargony/atom-language-rust#93

+1. Unfortunately, this is currently rendering Atom unusable for me, as I can't use it at work; our style guide requires 2 spaces, not 4 :(

You could try adding the following to your config in accordance with https://github.com/atom/language-python/issues/183#issuecomment-295388166 This sould help while the issue is resolved.

".python.source":
  editor:
    tabLength: 2

Frustratingly, this breaks Python folding too, which took me a very long time to realize stemmed from this issue. I guess the folding is dependent on the calculated value of tabLength, so if you aren't using the above fix mentioned by nikhilweee, and you have a python file that is indented with two spaces per level, "Fold Level 2" actually folds level 3, with seemingly no way to fold the whole file at even levels.

Was this page helpful?
0 / 5 - 0 ratings