emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot d66f2eb 39/45: Treat tab characters as 1 column w


From: João Távora
Subject: [elpa] externals/eglot d66f2eb 39/45: Treat tab characters as 1 column wide in position conversion functions
Date: Thu, 22 Nov 2018 19:15:33 -0500 (EST)

branch: externals/eglot
commit d66f2eb1d85c40291b55106d8d694d0298b3fddb
Author: Michał Krzywkowski <address@hidden>
Commit: Michał Krzywkowski <address@hidden>

    Treat tab characters as 1 column wide in position conversion functions
    
    Fixes #158.
    
    * eglot.el (eglot--pos-to-lsp-position): Call
      eglot-current-column-function with tab-width bound to 1.
    (eglot--lsp-position-to-point): Call eglot-move-to-column-function
    with tab-width bound to 1.
---
 eglot.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index 3ba1b87..d9c1c3a 100644
--- a/eglot.el
+++ b/eglot.el
@@ -743,7 +743,8 @@ for all others.")
   (eglot--widening
    (list :line (1- (line-number-at-pos pos t)) ; F!@&#$CKING OFF-BY-ONE
          :character (progn (when pos (goto-char pos))
-                           (funcall eglot-current-column-function)))))
+                           (let ((tab-width 1))
+                             (funcall eglot-current-column-function))))))
 
 (defvar eglot-move-to-column-function #'move-to-column
   "Function to move to a column reported by the LSP server.
@@ -778,7 +779,8 @@ If optional MARKER, return a marker instead"
     (forward-line (min most-positive-fixnum
                        (plist-get pos-plist :line)))
     (unless (eobp) ;; if line was excessive leave point at eob
-      (funcall eglot-move-to-column-function (plist-get pos-plist :character)))
+      (let ((tab-width 1))
+        (funcall eglot-move-to-column-function (plist-get pos-plist 
:character))))
     (if marker (copy-marker (point-marker)) (point))))
 
 (defun eglot--path-to-uri (path)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]