From f9b59cf71f9aa31296642231856536be1618035f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 29 Nov 2019 23:42:58 +0000 Subject: [PATCH] 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. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/361 --- lisp/progmodes/eglot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 888eacc690a..cbfb926036a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/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 -- 2.39.2