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

Support editor.tabType #8356

Merged
merged 12 commits into from
Aug 13, 2015
Merged

Support editor.tabType #8356

merged 12 commits into from
Aug 13, 2015

Conversation

benogle
Copy link
Contributor

@benogle benogle commented Aug 13, 2015

This does the simplest thing possible. When editor.tabType is set to auto, it does what it did before. When it is set to hard or soft, it uses those values all the time unless setSoftTabs() is explicitly called. The API is unchanged. Specs have been consolidated a bit as there were a couple places where the tab stuff was being tested.

Eventually (another PR), I'd like to change the name of editor.softTabs setting to editor.defaultTabType or something more clear.

Closes #8186 @Abdillah, I've used a couple of your commits.
Closes #3719

@@ -176,9 +176,15 @@ class TextEditor extends Model
@subscribe @displayBuffer.onDidAddDecoration (decoration) => @emit 'decoration-added', decoration
@subscribe @displayBuffer.onDidRemoveDecoration (decoration) => @emit 'decoration-removed', decoration

subscribeToTabTypeConfig: ->
@tabTypeSubscription?.dispose()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not super pretty. As I need to either add it to @disposables then remove on a grammar change, or explicitly destroy it in the destroyed method. I chose the latter

@maxbrunsfeld
Copy link
Contributor

Do you think we should deprecate editor.softTabs?

@benogle
Copy link
Contributor Author

benogle commented Aug 13, 2015

One caveat with this is: if the user has explicitly set the soft tabs value to something and an event happens (config or grammar change), the user's setting is ignored and computed based on the rules of the setting. I thought it added extra complexity to support tracking the explicitly set choice, and I wasnt sure if it would be the correct behavior anyway.

@benogle
Copy link
Contributor Author

benogle commented Aug 13, 2015

Do you think we should deprecate editor.softTabs?

We could change the name to editor.defaultTabType or something? Or yeah, we could deprecate it.

@benogle benogle mentioned this pull request Aug 13, 2015
@benogle
Copy link
Contributor Author

benogle commented Aug 13, 2015

Anyone opposed to merging this?

@maxbrunsfeld
Copy link
Contributor

🚢

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants