Store line endings on a per-line basis in Buffer

The line ending for each line is recorded and reused
when lines are modified or inserted.

Closes #166
This commit is contained in:
Kevin Sawicki & Nathan Sobo
2013-01-27 15:45:53 -08:00
parent ecc50506c7
commit 98614592af
9 changed files with 108 additions and 33 deletions

View File

@@ -1076,8 +1076,11 @@ class Editor extends View
position += token.value.length
popScope() while scopeStack.length > 0
if not @mini and invisibles?.eol
line.push("<span class='invisible'>#{invisibles.eol}</span>")
if invisibles and not @mini
if invisibles.cr and screenLine.lineEnding is '\r\n'
line.push("<span class='invisible'>#{invisibles.cr}</span>")
if invisibles.eol
line.push("<span class='invisible'>#{invisibles.eol}</span>")
line.push('</pre>')
line.join('')