From 35e431c829d7e554e6c0ab38dde59fee870506a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 13 Nov 2018 09:46:47 +0000 Subject: [PATCH] Tweak solution to with a hint from fangrui song * eglot.el (eglot-move-to-lsp-abiding-column): Simplify slightly. GitHub-reference: https://github.com/joaotavora/eglot/issues/125 --- lisp/progmodes/eglot.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 512e9a689fa..24f8c971f91 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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. -- 2.39.2