From aa9728c004f996503e1bbdd3aaed5be071a6a445 Mon Sep 17 00:00:00 2001 From: Michael Herring Date: Sun, 24 Aug 2014 19:04:46 +0900 Subject: [PATCH] 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. --- src/editor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.coffee b/src/editor.coffee index 451e84b0c..2e8269ff9 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -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.