From fbdc85aa5852cc313d356b7f0f173f4d908ea920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 29 Nov 2019 23:42:58 +0000 Subject: [PATCH] Fix https://github.com/joaotavora/eglot/issues/361: abide by LSP when reporting and moving to columns * eglot.el (eglot-current-column-function): Set to eglot-lsp-abiding-column. (eglot-move-to-column-function): Set to eglot-move-to-lsp-abiding-column. --- eglot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eglot.el b/eglot.el index 888eacc690..cbfb926036 100644 --- a/eglot.el +++ b/eglot.el @@ -999,7 +999,7 @@ CONNECT-ARGS are passed as additional arguments to (defun eglot-current-column () (- (point) (point-at-bol))) -(defvar eglot-current-column-function #'eglot-current-column +(defvar eglot-current-column-function #'eglot-lsp-abiding-column "Function to calculate the current column. This is the inverse operation of @@ -1023,7 +1023,7 @@ for all others.") :character (progn (when pos (goto-char pos)) (funcall eglot-current-column-function))))) -(defvar eglot-move-to-column-function #'eglot-move-to-column +(defvar eglot-move-to-column-function #'eglot-move-to-lsp-abiding-column "Function to move to a column reported by the LSP server. According to the standard, LSP column/character offsets are based