Don't allow the tab length to go below 1

Closes #1751
This commit is contained in:
Kevin Sawicki
2014-03-12 18:00:11 -07:00
parent f272d9abde
commit 68c2c18d83
2 changed files with 13 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ class TokenizedBuffer extends Model
visible: false
constructor: ({@buffer, @tabLength}) ->
@tabLength ?= atom.config.get('editor.tabLength') ? 2
@tabLength ?= atom.config.getPositiveInt('editor.tabLength', 2)
@subscribe atom.syntax, 'grammar-added grammar-updated', (grammar) =>
if grammar.injectionSelector?
@@ -40,7 +40,7 @@ class TokenizedBuffer extends Model
@emit "changed", { start: 0, end: lastRow, delta: 0 }
@subscribe atom.config.observe 'editor.tabLength', callNow: false, =>
@setTabLength(atom.config.getPositiveInt('editor.tabLength'))
@setTabLength(atom.config.getPositiveInt('editor.tabLength', 2))
@reloadGrammar()