B:BD[
3.1978] → [
3.1978:2069]
B:BD[
3.2069] → [
2.481:540]
∅:D[
2.540] → [
3.2105:2417]
B:BD[
3.2105] → [
3.2105:2417]
B:BD[
3.2417] → [
2.541:595]
∅:D[
2.595] → [
3.2464:2827]
B:BD[
3.2464] → [
3.2464:2827]
else
local screen_line_posA = Text.nearest_cursor_pos(s, mx, State.left)
if not State.expanded and not line.expanded then
-- B side is not expanded
return screen_line_starting_pos + screen_line_posA - 1
end
local lenA = utf8.len(s)
if screen_line_posA < lenA then
-- mx is within A side
return screen_line_starting_pos + screen_line_posA - 1
end
local max_xA = State.left+Text.x(s, lenA+1)
if mx < max_xA + AB_padding then
-- mx is in the space between A and B side
return screen_line_starting_pos + screen_line_posA - 1
end
local mx = mx - max_xA - AB_padding
local screen_line_posB = Text.nearest_cursor_pos(line.dataB, mx, --[[no left margin]] 0)
return nil, screen_line_posB
end
local screen_line_posA = Text.nearest_cursor_pos(s, mx, State.left)
if not State.expanded and not line.expanded then
-- B side is not expanded
return screen_line_starting_pos + screen_line_posA - 1
end
local lenA = utf8.len(s)
if screen_line_posA < lenA then
-- mx is within A side
return screen_line_starting_pos + screen_line_posA - 1
end
local max_xA = State.left+Text.x(s, lenA+1)
if mx < max_xA + AB_padding then
-- mx is in the space between A and B side
return screen_line_starting_pos + screen_line_posA - 1