- (eldox-box--eldoc-message-function): doesn't cleanup childframe
when passed with nil anymore
I finally figured out why the flicker occurs:
1. when eldoc asks for doc string, elgot returns nil immeditaly
2. when you move out of a eldoc-cable symbol and move back in
the childframe isn't cleaned up. Adn eldoc recieves nil from
eglot, passes that to message function (eldoc-message)
-> (eldoc-message-function), eldoc-box gets it and cleans up
childframe. Then eglot recieved doc string from server
and calls (eldoc-message), childframe is then redisplayed.
Since eldoc-box cleans up after itself and doesn't rely on eldoc
to cleanup. A quick fix is simply don't clean up when eldoc-box
(eldoc-box--eldoc-message-function) recieves nil from eldoc
(eldoc-message).
- Add eldoc-box--last-point
- eldoc-box--display sets eldoc-box-hover-mode to t in doc buffer
- eldoc-box--maybe-cleanup checks more things to decide whether to
clear frame
- eldoc-box--eldoc-message-function sets eldoc-box--last-point to
(point)
* eldoc-box.el (eldoc-box--maybe-cleanup): Set timer var to nil
unconditionally.
(eldoc-box--eldoc-message-function): Rescheduler timer here.
(eldoc-box-hover-mode): Simplify.
(eldoc-box--maybe-cancel-timer, eldoc-box--enabled-buffer-list):
Not needed.
Uses a :before-until advice on the local value of
eldoc-message-function instead of setting it directly. Thus, when we
give up because of eldoc-box-only-multi-line (or some other future
criteria), other :before-until handlers can kick in.
* eldoc-box.el (eldoc-box--eldoc-message-function): Control return of
t or nil.
(eldoc-box-hover-mode): Use add-function and
remove-function.
Don't cancel and create new timers naively.
Only cancel timer (and set to nil) when there is no live buffer
with eldoc-box-hover-mode enabled;
and only create new timer when none exists.
Add cleanup function and a idle timer
Why a timer? ElDoc is mainly use in minibuffer,
where the text is constantly being flushed by other commands
so ElDoc doesn't try very hard to cleanup