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

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

[elpa] externals/eglot 42fffa5 16/62: Close #54: Correctly make LSP posi


From: Stefan Monnier
Subject: [elpa] externals/eglot 42fffa5 16/62: Close #54: Correctly make LSP positions in narrowed buffers
Date: Sat, 29 Sep 2018 17:13:30 -0400 (EDT)

branch: externals/eglot
commit 42fffa5806adddd19efb2cb9a9d94544b34bcb15
Author: mkcms <address@hidden>
Commit: João Távora <address@hidden>

    Close #54: Correctly make LSP positions in narrowed buffers
    
    * eglot.el (eglot--pos-to-lsp-position): Fix return value when
      narrowing is in effect.
---
 eglot.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eglot.el b/eglot.el
index 3c01657..fbc6a53 100644
--- a/eglot.el
+++ b/eglot.el
@@ -597,10 +597,10 @@ CONNECT-ARGS are passed as additional arguments to
 
 (defun eglot--pos-to-lsp-position (&optional pos)
   "Convert point POS to LSP position."
-  (save-excursion
-    (list :line (1- (line-number-at-pos pos t)) ; F!@&#$CKING OFF-BY-ONE
-          :character (- (goto-char (or pos (point)))
-                        (line-beginning-position)))))
+  (eglot--widening
+   (list :line (1- (line-number-at-pos pos t)) ; F!@&#$CKING OFF-BY-ONE
+         :character (- (goto-char (or pos (point)))
+                       (line-beginning-position)))))
 
 (defun eglot--lsp-position-to-point (pos-plist &optional marker)
   "Convert LSP position POS-PLIST to Emacs point.



reply via email to

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