From 7a3930cae6a946b6794a1c75fb7df5fbb875a661 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Thu, 16 May 2019 23:08:48 -0700 Subject: [PATCH] fix line number highlighting after mode changes - Closes #764 --- components/Carbon.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/Carbon.js b/components/Carbon.js index 5509a5f..2ab22e0 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -33,6 +33,16 @@ class Carbon extends React.PureComponent { onChange: () => {} } + componentDidUpdate(prevProps) { + // TODO keep opacities in state + if ( + prevProps.config.theme != this.props.config.theme || + prevProps.config.language != this.props.config.language + ) { + this.prevLine = null + } + } + handleLanguageChange = debounce( (newCode, language) => { if (language === 'auto') {