Fix `drawwhitespace` drawing lines with different substitution kinds
When multiple substitution kinds are present in the same line, they're placed in the cache in an order that's spatially consistent only between items of the same kind. Because we stopped drawing after we reached the first invisible substitution, the subsequent kinds weren't drawn even if they should have been.
This commit is contained in:
parent
0030c69524
commit
8a9bac7de3
|
@ -290,14 +290,15 @@ function DocView:draw_line_text(idx, x, y)
|
|||
local ty = y + self:get_line_text_y_offset()
|
||||
local cache = ws_cache[self.doc.highlighter][idx]
|
||||
for i=1,#cache,4 do
|
||||
local sub = cache[i]
|
||||
local tx = cache[i + 1] + x
|
||||
local tw = cache[i + 2]
|
||||
if tx <= x2 then
|
||||
local sub = cache[i]
|
||||
local color = cache[i + 3]
|
||||
if tx + tw >= x1 then
|
||||
tx = renderer.draw_text(font, sub, tx, ty, color)
|
||||
end
|
||||
if tx > x2 then break end
|
||||
end
|
||||
end
|
||||
|
||||
return draw_line_text(self, idx, x, y)
|
||||
|
|
Loading…
Reference in New Issue