From d599dfd79f17eea5e4a9708dd29336149ac386ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 2 Jul 2018 23:09:27 +0100 Subject: [PATCH] Handle outrageously large and buggy line numbers * 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8cad3ad1b58..509fe6c88dc 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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)))) -- 2.39.2