Merge pull request #1322 from atom/bo-fix-tabs-and-soft-wrap

Dont re-atomicize atomic tokens
This commit is contained in:
Ben Ogle 2013-12-16 15:56:22 -08:00
commit 43baee5abd
2 changed files with 10 additions and 0 deletions

View File

@ -90,6 +90,14 @@ describe "DisplayBuffer", ->
expect(displayBuffer.lineForRow(3).text).toBe ' var pivot = items.shift(), current, left = [], '
expect(displayBuffer.lineForRow(4).text).toBe 'right = [];'
describe "when there are hard tabs", ->
beforeEach ->
buffer.setText(buffer.getText().replace(new RegExp(' ', 'g'), '\t'))
it "correctly tokenizes the hard tabs", ->
expect(displayBuffer.lineForRow(3).tokens[0].isHardTab).toBeTruthy()
expect(displayBuffer.lineForRow(3).tokens[1].isHardTab).toBeTruthy()
describe "when the buffer changes", ->
describe "when buffer lines are updated", ->
describe "when whitespace is added after the max line length", ->

View File

@ -57,6 +57,8 @@ class Token
outputTokens
else
return [this] if @isAtomic
if breakOutLeadingWhitespace
return [this] unless /^[ ]|\t/.test(@value)
else