GNU bug report logs -
#70193
eglot: RFE: recenter buffer upon showDocument request
Previous Next
Full log
View this message in rfc822 format
In eglot 1.17, the LSP showDocument downcall opens the designated
file, moves the cursor to the designated position, and raises the
frame. One other thing it could do to make it easier to see where the
cursor is would be to recenter the buffer.
The patch below is a minimal fix; the discussion at
https://github.com/joaotavora/eglot/discussions/1382 suggests a couple
of possible refinements.
xtools$ git diff ~/.emacs.d/elpa/eglot-1.17/eglot.el{.bak,}
--- elpa/eglot-1.17/eglot.el.orig
+++ elpa/eglot-1.17/eglot.el
@@ -2460,6 +2460,7 @@ THINGS are either registrations or
unregisterations (sic)."
;; function, but `xref--goto-char' happens to have
;; exactly the semantics we want vis-a-vis widening.
(xref--goto-char beg)
+ (recenter)
(pulse-momentary-highlight-region beg end 'highlight)))))))
(t (setq success :json-false)))
`(:success ,success)))
This bug report was last modified 1 year and 108 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.