mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
🐎 Use direct comparison instead of regex
This commit is contained in:
@@ -835,8 +835,11 @@ class Editor extends Model
|
||||
usesSoftTabs: ->
|
||||
for bufferRow in [0..@buffer.getLastRow()]
|
||||
continue if @displayBuffer.tokenizedBuffer.lineForScreenRow(bufferRow).isComment()
|
||||
if match = @buffer.lineForRow(bufferRow).match(/^[ \t]/)
|
||||
return match[0][0] is ' '
|
||||
|
||||
line = @buffer.lineForRow(bufferRow)
|
||||
return true if line[0] is ' '
|
||||
return false if line[0] is '\t'
|
||||
|
||||
undefined
|
||||
|
||||
# Public: Returns a {Boolean} indicating whether softTabs are enabled for this
|
||||
|
||||
Reference in New Issue
Block a user