Merge template-live-editor

This commit is contained in:
Kartik K. Agaram 2023-12-26 11:37:08 -08:00
commit a850ddcf98
1 changed files with 2 additions and 1 deletions

View File

@ -779,7 +779,8 @@ function Text.nearest_pos_less_than(line, x)
end
function Text.x_after(s, pos)
local offset = Text.offset(s, math.min(pos+1, #s+1))
local len = utf8.len(s)
local offset = Text.offset(s, math.min(pos+1, len+1))
local s_before = s:sub(1, offset-1)
--? print('^'..s_before..'$')
return App.width(s_before)