RJGZD4INLQ3IAWLCBYBZQDMP4ICSMZWJX2TRYODDYVUNMGPL6GYAC local line_before_cursor = lines[cursor_line]:sub(1, cursor_pos-1)local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor)love.graphics.print('_', 25+text_before_cursor:getWidth()*1.5, y+6) -- drop the cursor down a bit to account for the increased font size
love.graphics.print('_', 25+cursor_x(lines[cursor_line], cursor_pos)*1.5, y+6) -- drop the cursor down a bit to account for the increased font size
endendendfunction cursor_x(line, cursor_pos)local line_before_cursor = line:sub(1, cursor_pos-1)local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor)return text_before_cursor:getWidth()endfunction nearest_cursor_pos(line, x)if x == 0 thenreturn 1endlocal left, right = 1, #line+1while left < right-1 dolocal curr = math.floor((left+right)/2)local currx = cursor_x(line, curr)if currx > x-2 and currx < x+2 thenreturn curr