B:BD[
3.2228] → [
3.2228:2544]
local line,pos_index = 1,1
Text.populate_screen_line_starting_pos(pane, line)
while y_offset >= Line_height do
pos_index = pos_index + 1
if pos_index > #pane.line_cache[line].screen_line_starting_pos then
line = line+1
pos_index = 1
Text.populate_screen_line_starting_pos(pane, line)
for i=1,#pane.lines do
Text.populate_screen_line_starting_pos(pane, i)
local height = line_height(pane, i, pane.left, pane.right)
if y_offset < height then
local line = pane.lines[i]
if line.mode ~= 'text' then
return {line=i, pos=1}, y_offset
else
local nlines = math.floor(y_offset/pane.line_height)
local pos = pane.line_cache[i].screen_line_starting_pos[nlines+1] -- switch to 1-indexing
y_offset = y_offset - nlines*pane.line_height
return {line=i, pos=pos}, y_offset
end