🐎 Don't get every line to check for soft-tabs

Getting all the lines requires SharedString to construct a big array.
It's more efficient to check them one line at a time.
This commit is contained in:
Nathan Sobo
2013-08-30 14:24:02 -06:00
parent 4cc553daf8
commit 91adc01e4e

View File

@@ -593,8 +593,8 @@ class TextBuffer
#
# Returns a {Boolean},
usesSoftTabs: ->
for line in @getLines()
if match = line.match(/^\s/)
for row in [0..@getLastRow()]
if match = @lineForRow(row).match(/^\s/)
return match[0][0] != '\t'
undefined