Merge branch 'master' into ns-property-selectors

This commit is contained in:
Nathan Sobo
2014-03-24 18:01:44 -06:00
5 changed files with 33 additions and 20 deletions

View File

@@ -44,6 +44,7 @@ class EditorView extends View
@configDefaults:
fontFamily: ''
fontSize: 16
lineHeight: 1.3
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.lineHeight', (lineHeight) => @setLineHeight(lineHeight)
handleEvents: ->
@on 'focus', =>
@@ -747,6 +750,14 @@ class EditorView extends View
# Returns a {String} identifying the CSS `font-family`.
getFontFamily: -> @css("font-family")
# Public: Sets the line height of the editor
#
# lineHeight - A {Number} without a unit suffix identifying the CSS
# `line-height`.
setLineHeight: (lineHeight) ->
@css('line-height', lineHeight)
@redraw()
# Public: Redraw the editor
redraw: ->
return unless @hasParent()
@@ -885,7 +896,7 @@ class EditorView extends View
@setHeightInLines()
recalculateDimensions: ->
return unless @attached
return unless @attached and @isVisible()
oldCharWidth = @charWidth
oldLineHeight = @lineHeight