noctuid/link-hint.el

Prevent scrolling during collection?

Opened this issue · 1 comments

We do set scroll-margin to zero when placing the avy overlays, but we should maybe do something prevent scrolling/window movement during collection as well (related: #181). Not sure if there are situations where this will cause issues.

In Customize buffers there is an issue with scrolling happening right after the candidates collection, if point is at the window end.

The scrolling may be triggered by the echo area growth. The echo area may grow because every link help text gets printed during candidate collection process. These messages also pollute the *Messages* buffer.

I wasn't able to figure out why the messages are printed; but I found a workaround to disable the minibuffer growth:

(defun my-with-inhibit-resize-mini-widows (function &rest arguments)
  "Call FUNCTION with ARGUMENTS, with `resize-mini-windows' bound to nil."
  (let ((resize-mini-windows nil))
    (apply function arguments)))
    
(advice-add 'link-hint-open-link :around #'my-with-inhibit-resize-mini-widows)
;; (advice-remove 'link-hint-open-link  #'my-with-inhibit-resize-mini-widows)

Here are some screenshots of the issue. The point is on the triangle glyph to the left from the text "Modus Themes Bold Constructs". Ah, and scroll-margin equals 1.

link-hint-before
link-hint-after