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