Function: eglot-move-to-utf-8-linepos

eglot-move-to-utf-8-linepos is a byte-compiled function defined in eglot.el.gz.

Signature

(eglot-move-to-utf-8-linepos N)

Documentation

Move to line's Nth byte as computed by LSP's UTF-8 criterion.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defun eglot-move-to-utf-8-linepos (n)
  "Move to line's Nth byte as computed by LSP's UTF-8 criterion."
  (let* ((bol (eglot--bol))
         (goal-byte (+ (position-bytes bol) n))
         (eol (line-end-position)))
    (goto-char bol)
    (while (and (< (position-bytes (point)) goal-byte) (< (point) eol))
      ;; raw bytes take 2 bytes in the buffer
      (when (>= (char-after) #x3fff80) (setq goal-byte (1+ goal-byte)))
      (forward-char 1))))