From f7f6bf47ae6168fe3410d670611f3796e93756e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 13 Nov 2018 09:46:47 +0000 Subject: [PATCH] Tweak solution to https://github.com/joaotavora/eglot/issues/125 with a hint from Fangrui Song * eglot.el (eglot-move-to-lsp-abiding-column): Simplify slightly. --- eglot.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index 512e9a689f..24f8c971f9 100644 --- a/eglot.el +++ b/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.