mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user