GNU bug report logs -
#70193
eglot: RFE: recenter buffer upon showDocument request
Previous Next
Full log
Message #14 received at 70193 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> +cc Martin Rudalics (as suggested by Joao Tavora)
I refer to the following text from
https://github.com/joaotavora/eglot/discussions/1382
> A variant of recenter that centers the whole selection if
> (and only if) it fits might be a useful addition, perhaps to the the
> core elisp library. In our case, which I suspect is fairly typical, the
> selection is a single identifier such as a function or type declaration,
> so the behavior of recenter is ideal, as it allows you to see the doc
> comments above the declaration and (at least the start of) the function
> body below it.
The attached 'window-recenter-region-start-position' should address
that. I am not aware of whether we have a function on master to get the
line height of a specific window as if a specific buffer were displayed
in it so I used 'frame-char-height' for the window in question. The
rest of the function is straightforward but there might be off-by-one
glitches.
Roughly tested with the also contained 'recenter-region'.
martin
[recenter-region.el (text/x-emacs-lisp, attachment)]
This bug report was last modified 1 year and 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.