Skip to content

Commit

Permalink
Tweak solution to joaotavora/eglot#125 with a hint from Fangrui Song
Browse files Browse the repository at this point in the history
* eglot.el (eglot-move-to-lsp-abiding-column): Simplify slightly.
  • Loading branch information
joaotavora committed Nov 13, 2018
1 parent 4535cc6 commit f7f6bf4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions eglot.el
Expand Up @@ -752,8 +752,7 @@ managed by those servers.")
2)
2))
until (zerop diff)
for offset = (max 1 (abs (/ diff 2)))
do (if (> diff 0) (forward-char offset) (backward-char offset))))
do (forward-char (/ (if (> diff 0) (1+ diff) (1- diff)) 2))))

(defun eglot--lsp-position-to-point (pos-plist &optional marker)
"Convert LSP position POS-PLIST to Emacs point.
Expand Down

0 comments on commit f7f6bf4

Please sign in to comment.