Skip to content

Commit

Permalink
Fix #361: abide by LSP when reporting and moving to columns
Browse files Browse the repository at this point in the history
* 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.

#361: joaotavora/eglot#361
  • Loading branch information
joaotavora authored and nemethf committed Jan 8, 2020
1 parent f1c1d86 commit ec07a47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ec07a47

Please sign in to comment.