From 91adc01e4e4d6c40923be8e9d28665850b071606 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 30 Aug 2013 14:24:02 -0600 Subject: [PATCH] :racehorse: 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. --- src/text-buffer.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index f206e2746..8b5ac5fdf 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -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