From: João Távora Date: Fri, 29 Nov 2019 23:42:58 +0000 (+0000) Subject: Abide by lsp when reporting and moving to columns X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~257 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f9b59cf71f9aa31296642231856536be1618035f;p=emacs.git 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 --- 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