From 63ce6cae030bac43ee919eeefb1fddc8043f683e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 1 Oct 2015 14:20:53 +0200 Subject: [PATCH] :bug: Fix an issue where yardstick cache wasn't being emptied --- src/text-editor-component.coffee | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index e684805ec..170c90bbf 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -269,9 +269,15 @@ class TextEditorComponent timeoutId = setTimeout(writeSelectedTextToSelectionClipboard) observeConfig: -> - @disposables.add atom.config.onDidChange 'editor.fontSize', @sampleFontStyling - @disposables.add atom.config.onDidChange 'editor.fontFamily', @sampleFontStyling - @disposables.add atom.config.onDidChange 'editor.lineHeight', @sampleFontStyling + @disposables.add atom.config.onDidChange 'editor.fontSize', => + @sampleFontStyling() + @invalidateCharacterWidths() + @disposables.add atom.config.onDidChange 'editor.fontFamily', => + @sampleFontStyling() + @invalidateCharacterWidths() + @disposables.add atom.config.onDidChange 'editor.lineHeight', => + @sampleFontStyling() + @invalidateCharacterWidths() onGrammarChanged: => if @scopedConfigDisposables? @@ -706,6 +712,7 @@ class TextEditorComponent if @fontSize isnt oldFontSize or @fontFamily isnt oldFontFamily or @lineHeight isnt oldLineHeight @clearPoolAfterUpdate = true @measureLineHeightAndDefaultCharWidth() + @invalidateCharacterWidths() sampleBackgroundColors: (suppressUpdate) -> {backgroundColor} = getComputedStyle(@hostElement)