Use <pre> tag for lines instead of using white-space: pre css property

One less CSS rule, since the whitespace behavior of a `pre` tag is already baked into the browser's default styles.
This commit is contained in:
Nathan Sobo
2012-09-25 13:09:12 -06:00
parent e8e9abc0b8
commit d3df0a305b
2 changed files with 2 additions and 8 deletions

View File

@@ -669,7 +669,7 @@ class Editor extends View
selectionView.remove() for selectionView in @getSelectionViews()
calculateDimensions: ->
fragment = $('<div class="line" style="position: absolute; visibility: hidden;"><span>x</span></div>')
fragment = $('<pre class="line" style="position: absolute; visibility: hidden;"><span>x</span></div>')
@renderedLines.append(fragment)
lineRect = fragment[0].getBoundingClientRect()
@@ -812,7 +812,7 @@ class Editor extends View
lineAttributes.class += ' selected'
else
lineAttributes = { class: 'line' }
@div lineAttributes, =>
@pre lineAttributes, =>
if line.text == ''
@raw '&nbsp;' if line.text == ''
else

View File

@@ -72,12 +72,6 @@
width: 100%;
}
.editor .line, .gutter .line-number {
white-space: pre;
margin: 0;
padding: 0;
}
.editor .line > span {
vertical-align: top;
}