Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Add new editor.tabType scoped setting #3719

Closed

Description

@benogle

While digging into scoping editor.softTabs in #3718, it's pretty clear that the setting has very little influence on the actual value chosen. It's effectively the worst-case fallback: it only works on an empty file.

I propose doing a couple things:

  • adding a new editor.tabType setting that accepts 3 values: Auto, Hard, Soft. With the default being auto. Then in the scoped settings for each language, they can set it to whatever they want.
  • Changing TextEditor::setSoftTabs to being a settings override accepting 4 values: unset / use-the-settings, Auto, Hard, Soft
  • Reading the settings on each time we need to get the tab type. Something like (pseudo code):
getTabType: (scopeDescriptor) ->
  @userTabTypeOverride or atom.config.get(scopeDescriptor, 'editor.tabType') or atom.config.get(scopeDescriptor, 'editor.softTabs') or 'soft'

See

@softTabs = @usesSoftTabs() ? @softTabs ? atom.config.get('editor.softTabs') ? true
and
buildIndentString: (number, column=0) ->
for reference.

Refs

Comment if you know of more issues, complaints. I know there have been several complaints about this, but cant find issues.

Activity

  1. self-assigned this
    on Oct 3, 2014
  2. benogle commented on Oct 8, 2014

    @benogle
    ContributorAuthor

    Thanks @lee-dohm that's exactly what I was looking for.

  3. benogle commented on Oct 8, 2014

    @benogle
    ContributorAuthor

    Removing from the API freeze roadmap as it is not necessary for the api freeze. Will happen shortly after.

  4. ilanbiala commented on Dec 24, 2014

    @ilanbiala

    Also please add support for per language soft tabs support somehow.

  5. 10 remaining items

  6. xaviergmail commented on Jun 28, 2015

    @xaviergmail

    👍 I find myself having to replace all tabs with spaces and re-open a file to get tab to insert spaces properly, which isn't very intuitive.

  7. JeffreyVdb commented on Jun 29, 2015

    @JeffreyVdb

    This should be made possible language specifically. Most languages have their own coding conventions. This is a critical bug if you ask me.

  8. pbhogan commented on Jun 29, 2015

    @pbhogan

    👍 Can't even think of switching to Atom for actual work until this is fixed.

  9. fedorov commented on Jun 29, 2015

    @fedorov
    Contributor

    +1

  10. unRob commented on Jun 30, 2015

    @unRob

    +1

  11. thomasjo commented on Jun 30, 2015

    @thomasjo
    Contributor

    All the +1's only add noise at this point, so I'm locking this issue until someone begins working on it. At that point we may re-open it for discussion purposes.

  12. locked and limited conversation to collaborators on Jun 30, 2015
  13. unlocked this conversation on Aug 13, 2015
  14. jeffmcneill commented on Jun 13, 2016

    @jeffmcneill

    Most reports of issues seem to be closed without resolving the underlying problem. There is only one open I could find (on cursory clicking):

    Closed

    Open

    The big issue as reported is the inaccurate "guessing" combined with the inability for an editor-wide setting (and not per-file setting). It may be that several preferences may be required instead of having one monolithic setting which is clearly causing unhappiness:

    • Default for all files (y/n)
    • Default for certain files (by file extension)
    • Setting on per file basis

    The idea would be to be able to re-order these in terms of priority, based on the needs of the user.

  15. asbjornu commented on May 7, 2017

    @asbjornu

    I'm with @jeffmcneill on this one; it's still a problem in Atom 1.16.0 and the current settings just doesn't work. The editor-settings package outlines a lot of the functionality I would like to see in Atom wrt. whitespace handling, but it also does not work correctly as it seems to be fighting with Atom on what tab type should be used. Couple that with the whitespace package and you have complete chaos.

    I would love to see the current settings, packages and everything related to whitespace wiped from the face of the earth, because it's bug-ridden junk that Just Doesn't Work. Then, I would like to see something implemented along these lines:

    1. A base setting for tab preference that did not try to be smart in any way. Just a clear "hard tab" or "spaces" (the phrase "soft tab" is just confusing; please get rid of it) that perhaps can have a checkbox for "change existing whitespace on save".
    2. A way à la editor-settings to configure tab preference for every language (and/or file type). This should override the previous setting.
    3. Support for EditorConfig. If there's an .editorconfig file in the project file hierarchy that is an ancestor or sibling to the current file, use that to adjust the tab setting of the file. This should override previous settings.

    With these three levels all supported within Atom without any packages, I believe it's possible to reach sanity and get rid of a lot of bug-ridden, "intelligent" code that obviously doesn't work and also serve the needs of most people.

  16. lock commented on Apr 2, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  17. locked and limited conversation to collaborators on Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions