Better autodetection of Soft Tabs.

Check for the presence of a space, instead of the absence of a tab.
This ensures that Soft Tabs will not be activated on a file that (for
example) starts with a BOM or something, but is otherwise full of hard
tabs.
This commit is contained in:
Michael Herring
2014-08-24 19:04:46 +09:00
parent a15deaef81
commit aa9728c004

View File

@@ -354,7 +354,7 @@ class Editor extends Model
for bufferRow in [0..@buffer.getLastRow()]
continue if @displayBuffer.tokenizedBuffer.lineForScreenRow(bufferRow).isComment()
if match = @buffer.lineForRow(bufferRow).match(/^\s/)
return match[0][0] != '\t'
return match[0][0] == ' '
undefined
# Public: Clip the given {Point} to a valid position in the buffer.