mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
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:
@@ -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 ' ' if line.text == ''
|
||||
else
|
||||
|
||||
@@ -72,12 +72,6 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.editor .line, .gutter .line-number {
|
||||
white-space: pre;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editor .line > span {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user