@@ -72,6 +72,7 @@ function Highlighter.highlight(props: HighlightProps)
7272 local src = SanitizeTabs (SanitizeControl (props .src or textObject .Text ))
7373 local lexer = props .lexer or Highlighter .defaultLexer
7474 local customLang = props .customLang
75+ local forceUpdate = props .forceUpdate
7576
7677 -- Avoid updating when unnecessary
7778 local data = LastData [textObject ]
@@ -84,7 +85,7 @@ function Highlighter.highlight(props: HighlightProps)
8485 CustomLang = customLang ,
8586 }
8687 LastData [textObject ] = data
87- elseif props . forceUpdate ~= true and data .Text == src then
88+ elseif forceUpdate ~= true and data .Text == src then
8889 return
8990 end
9091
@@ -238,7 +239,7 @@ function Highlighter.highlight(props: HighlightProps)
238239
239240 -- If multiline token, then set line & move to next
240241 if l > 1 then
241- if lines [lineNumber ] ~= previousLines [lineNumber ] then
242+ if forceUpdate or lines [lineNumber ] ~= previousLines [lineNumber ] then
242243 -- Set line
243244 lineLabels [lineNumber ].Text = table.concat (richText )
244245 end
@@ -249,7 +250,7 @@ function Highlighter.highlight(props: HighlightProps)
249250 end
250251
251252 -- If changed, add token to line
252- if lines [lineNumber ] ~= previousLines [lineNumber ] then
253+ if forceUpdate or lines [lineNumber ] ~= previousLines [lineNumber ] then
253254 index += 1
254255 -- Only add RichText tags when the color is non-default and the characters are non-whitespace
255256 if Color ~= TokenColors [" iden" ] and string.find (line , " [%S%C]" ) then
0 commit comments