Don't set an explicit line height on mini editors

This allows the line height to be styled via CSS. I would actually
like to allow all these properties to be assigned via CSS rather than
explicitly via the settings view, but that can be deferred until the
old editor is removed.
Esse commit está contido em:
Nathan Sobo
2014-07-13 14:45:38 -06:00
commit 544c759fd1
3 arquivos alterados com 11 adições e 4 exclusões
+3
Ver Arquivo
@@ -2016,6 +2016,9 @@ describe "EditorComponent", ->
component.setShowInvisibles(true)
expect(component.lineNodeForScreenRow(0).textContent).toBe 'var quicksort = function () {'
it "does not assign an explicit line-height on the editor contents", ->
expect(componentNode.style.lineHeight).toBe ''
describe "legacy editor compatibility", ->
it "triggers the screen-lines-changed event before the editor:display-update event", ->
editor.setSoftWrap(true)
+2 -1
Ver Arquivo
@@ -55,7 +55,8 @@ EditorComponent = React.createClass
maxLineNumberDigits = editor.getLineCount().toString().length
invisibles = if showInvisibles and not mini then @state.invisibles else {}
hasSelection = editor.getSelection()? and !editor.getSelection().isEmpty()
style = {fontSize, lineHeight, fontFamily}
style = {fontSize, fontFamily}
style.lineHeight = lineHeight unless mini
if @isMounted()
renderedRowRange = @getRenderedRowRange()
+6 -3
Ver Arquivo
@@ -85,15 +85,18 @@
}
}
.editor {
z-index: 0;
font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
line-height: 1.3;
}
.editor, .editor-contents {
overflow: hidden;
cursor: text;
display: -webkit-flex;
-webkit-user-select: none;
position: relative;
z-index: 0;
font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier;
line-height: 1.3;
}
.editor .gutter .line-number.cursor-line {