`drawwhitespace`: Invalidate cache on font size change
This commit is contained in:
parent
e784513222
commit
438ed6984a
|
@ -195,13 +195,19 @@ function DocView:draw_line_text(idx, x, y)
|
||||||
end
|
end
|
||||||
|
|
||||||
local font = (self:get_font() or style.syntax_fonts["whitespace"] or style.syntax_fonts["comment"])
|
local font = (self:get_font() or style.syntax_fonts["whitespace"] or style.syntax_fonts["comment"])
|
||||||
|
local font_size = font:get_size()
|
||||||
|
|
||||||
reset_cache_if_needed()
|
reset_cache_if_needed()
|
||||||
if
|
if
|
||||||
not ws_cache[self.doc.highlighter]
|
not ws_cache[self.doc.highlighter]
|
||||||
or ws_cache[self.doc.highlighter].font ~= font
|
or ws_cache[self.doc.highlighter].font ~= font
|
||||||
|
or ws_cache[self.doc.highlighter].font_size ~= font_size
|
||||||
then
|
then
|
||||||
ws_cache[self.doc.highlighter] = {font = font}
|
ws_cache[self.doc.highlighter] =
|
||||||
|
setmetatable(
|
||||||
|
{ font = font, font_size = font_size },
|
||||||
|
{ __mode = "k" }
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ws_cache[self.doc.highlighter][idx] then -- need to cache line
|
if not ws_cache[self.doc.highlighter][idx] then -- need to cache line
|
||||||
|
|
Loading…
Reference in New Issue