18 lines
519 B
Plaintext
18 lines
519 B
Plaintext
|
y_of_schema1 = function(editor, loc)
|
||
|
local result = 0
|
||
|
if loc.line == 1 and loc.pos == 1 then
|
||
|
return result
|
||
|
end
|
||
|
for i=1,loc.line-1 do
|
||
|
Text.populate_screen_line_starting_pos(editor, i)
|
||
|
result = result + line_height(editor, i)
|
||
|
end
|
||
|
Text.populate_screen_line_starting_pos(editor, loc.line)
|
||
|
for i,screen_line_starting_pos in ipairs(editor.line_cache[loc.line].screen_line_starting_pos) do
|
||
|
if screen_line_starting_pos >= loc.pos then
|
||
|
break
|
||
|
end
|
||
|
result = result + editor.line_height
|
||
|
end
|
||
|
return result
|
||
|
end
|