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.
  • Loading branch information
joaotavora committed Nov 29, 2019
1 parent 02f71fd commit 9fa4561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,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 @@ -1018,7 +1018,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 9fa4561

Please sign in to comment.