stop confusingly reading a global
The way Text.draw is called by edit.draw, we know it'll never be called for lines above screen_top1.line. Comparing every line on screen with screen_top1 makes no sense. The intent is really just to compare with screen_top1 only for the first line, and otherwise to ignore this check.
This commit is contained in:
parent
974d17ffc0
commit
9e0cd4ad4c
4
text.lua
4
text.lua
|
@ -17,7 +17,7 @@ function Text.draw(State, line_index, y, startpos)
|
|||
-- wrap long lines
|
||||
local x = State.left
|
||||
local pos = 1
|
||||
local screen_line_starting_pos = State.screen_top1.pos
|
||||
local screen_line_starting_pos = startpos
|
||||
if line_cache.fragments == nil then
|
||||
Text.compute_fragments(State, line_index)
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ function Text.draw(State, line_index, y, startpos)
|
|||
local frag, frag_text = f.data, f.text
|
||||
local frag_len = utf8.len(frag)
|
||||
--? print('text.draw:', frag, 'at', line_index,pos, 'after', x,y)
|
||||
if Text.lt1({line=line_index, pos=pos}, State.screen_top1) then
|
||||
if pos < startpos then
|
||||
-- render nothing
|
||||
--? print('skipping', frag)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue