add config option for explicitly setting the editor line height

This commit is contained in:
Justin Palmer
2014-03-18 15:57:53 -07:00
parent 023cb2ea55
commit 5eb12e671b

View File

@@ -44,6 +44,7 @@ class EditorView extends View
@configDefaults:
fontFamily: ''
fontSize: 16
editorLineHeight: 1
showInvisibles: false
showIndentGuide: false
showLineNumbers: true
@@ -340,6 +341,8 @@ class EditorView extends View
@subscribe atom.config.observe 'editor.invisibles', (invisibles) => @setInvisibles(invisibles)
@subscribe atom.config.observe 'editor.fontSize', (fontSize) => @setFontSize(fontSize)
@subscribe atom.config.observe 'editor.fontFamily', (fontFamily) => @setFontFamily(fontFamily)
@subscribe atom.config.observe 'editor.editorLineHeight', (editorLineHeight) => @setEditorLineHeight(editorLineHeight)
handleEvents: ->
@on 'focus', =>
@@ -742,6 +745,10 @@ class EditorView extends View
@redraw()
setEditorLineHeight: (editorLineHeight) ->
@css('line-height', editorLineHeight)
@redraw()
# Public: Gets the font family for the editor.
#
# Returns a {String} identifying the CSS `font-family`.