GNU bug report logs - #70193
eglot: RFE: recenter buffer upon showDocument request

Previous Next

Package: emacs;

Reported by: Alan Donovan <adonovan <at> google.com>

Date: Thu, 4 Apr 2024 13:18:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Alan Donovan <adonovan <at> google.com>
To: 70193 <at> debbugs.gnu.org
Cc: rudalics <at> gmx.at
Subject: bug#70193: Acknowledgement (eglot: RFE: recenter buffer upon showDocument request)
Date: Thu, 4 Apr 2024 09:32:35 -0400
+cc Martin Rudalics (as suggested by Joao Tavora)

On Thu, 4 Apr 2024 at 09:17, Alan Donovan <adonovan <at> google.com> wrote:
>
> 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.