]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle outrageously large and buggy line numbers
authorJoão Távora <joaotavora@gmail.com>
Mon, 2 Jul 2018 22:09:27 +0000 (23:09 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 2 Jul 2018 22:09:27 +0000 (23:09 +0100)
* eglot.el (eglot--lsp-position-to-point): Truncate line number to
most-positive-fixnum.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/34

lisp/progmodes/eglot.el

index 8cad3ad1b58b2d1e8f4e34fe712bd27f7fa05599..509fe6c88dc225e90778fba2509681edd58ca977 100644 (file)
@@ -602,7 +602,8 @@ CONNECT-ARGS are passed as additional arguments to
   "Convert LSP position POS-PLIST to Emacs point.
 If optional MARKER, return a marker instead"
   (save-excursion (goto-char (point-min))
-                  (forward-line (plist-get pos-plist :line))
+                  (forward-line (min most-positive-fixnum
+                                     (plist-get pos-plist :line)))
                   (forward-char (min (plist-get pos-plist :character)
                                      (- (line-end-position)
                                         (line-beginning-position))))