{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/issues/81","repository_url":"https://api.github.com/repos/sindresorhus/atom-editorconfig","labels_url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/issues/81/comments","events_url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/issues/81/events","html_url":"https://github.com/sindresorhus/atom-editorconfig/issues/81","id":147677658,"number":81,"title":"SoftTab-setting not working properly","user":{"login":"florianb","id":983507,"avatar_url":"https://avatars.githubusercontent.com/u/983507?v=3","gravatar_id":"","url":"https://api.github.com/users/florianb","html_url":"https://github.com/florianb","followers_url":"https://api.github.com/users/florianb/followers","following_url":"https://api.github.com/users/florianb/following{/other_user}","gists_url":"https://api.github.com/users/florianb/gists{/gist_id}","starred_url":"https://api.github.com/users/florianb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianb/subscriptions","organizations_url":"https://api.github.com/users/florianb/orgs","repos_url":"https://api.github.com/users/florianb/repos","events_url":"https://api.github.com/users/florianb/events{/privacy}","received_events_url":"https://api.github.com/users/florianb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/labels/meta","name":"meta","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-12T08:42:41Z","updated_at":"2016-04-15T03:48:45Z","closed_at":null,"body":"This issue is a meta-issue to protocol and order the debug-process around the issue and join issues which are likely being related to this bug.\r\n\r\nAny feedback, help, or suggestion is very appreciated. This issue is from now on the main place to discuss any related topics. This is also the staging area for Atom-related bugs which i will file after getting some feedback.\r\n\r\n## 🐛 Related Bugs/Issues\r\n\r\n- Setting the `indent_style` via `.editorconfig` is **not** or only partial **working**.\r\n- The SoftTab-setting falls sporadic back to `true` (using spaces).\r\n- Initially open Files when launching Atom always use SoftTabs.\r\n\r\n## 👓 Reasons\r\n\r\n#### 2.1. The `TextEditor.softTab`-setting may be overriden by a third-party package\r\n\r\nThis case couldn't be confirmed yet.\r\n\r\n#### 2.2 The SoftTab gets also set by `TextEditor.handleTokenization()`\r\n\r\nI currently do not know why and when `handleTokenization()` is being called, if it is [called](https://github.com/atom/atom/blob/master/src/text-editor.coffee#L3192) it always falls back to [SoftTabs](https://github.com/atom/atom/blob/master/src/text-editor.coffee#L2660) if the `tabType` is set to `auto`.\r\n\r\nI consider this being a bug in Atom.\r\n\r\n#### 2.3 The SoftTab gets also set by the `editor.tabTypeSubscription`\r\n\r\nThis is getting called if the general Atom-config setting for the `tabType` is being changed.\r\n\r\n#### 2.4. The `TextEditorElement.buildModel()` initializes the TextEditor with soft tabs\r\n\r\nThis instantiation hardcodes the SoftTab to be `true`. Even though i currently don't know exactly how the `TextEditorElement` plays with the `TextEditor` do i assume that the `TextEditor` is set to SoftTabs when it gets displayed the first time, from deserialization or caching.\r\n\r\nI consider this being a bug in Atom.\r\n\r\n## 🚦 Solving Strategies\r\n\r\n1. 🆙 Initiate the debug process for issues related to the Atom-project.\r\n2. 🐒 Create a monkeypatch to make at least a little bit working: the SoftTabs would be set properly after reopening Editors which where still open after Atom launch.\r\n\r\nI am sure i would like to upstream these findings to fix the probably wrong TextEditor behavior.\r\n\r\nI am not that sure about the monkeypatch. I did already some tests and of course i can easily override functions (in the case of `handleTokenization` i consider the patch as harmless). But it will still need a reopening of the specific Editor which is annoying.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/issues/comments/210272329","html_url":"https://github.com/sindresorhus/atom-editorconfig/issues/81#issuecomment-210272329","issue_url":"https://api.github.com/repos/sindresorhus/atom-editorconfig/issues/81","id":210272329,"user":{"login":"mven","id":940113,"avatar_url":"https://avatars.githubusercontent.com/u/940113?v=3","gravatar_id":"","url":"https://api.github.com/users/mven","html_url":"https://github.com/mven","followers_url":"https://api.github.com/users/mven/followers","following_url":"https://api.github.com/users/mven/following{/other_user}","gists_url":"https://api.github.com/users/mven/gists{/gist_id}","starred_url":"https://api.github.com/users/mven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mven/subscriptions","organizations_url":"https://api.github.com/users/mven/orgs","repos_url":"https://api.github.com/users/mven/repos","events_url":"https://api.github.com/users/mven/events{/privacy}","received_events_url":"https://api.github.com/users/mven/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T03:48:45Z","updated_at":"2016-04-15T03:48:45Z","body":"Found my problem: `Preferences > Settings > Tab Type` was set to `hard` for some reason (by default maybe?). Once I set it to `auto`, editorconfig is now setting `softTabs` properly."}}