Skip to content

Commit

Permalink
Tweak solution to #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 b9e9cf3 commit b31ba80
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions eglot.el
Original file line number Diff line number Diff line change
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 b31ba80

Please sign in to comment.