Closed seagle0128 closed 4 years ago
Hi @seagle0128.
I'm not sure if I understand your issue, could you elaborate a bit ?
Hi @seagle0128.
I'm not sure if I understand your issue, could you elaborate a bit ?
Sorry for the confusion! When displaying the candidates in company-box, the doc of the first candidate will be delayed 5 seconds to display although the it's set to 0.5s. The docs are displayed timely if moving up or down to select other candidates.
I can reproduce this problem. I've noticed this problem before.
@stardiviner so, can u pls try this snippet and check if there is any side-effect?
(defun company-box-doc (selection frame)
(when company-box-doc-enable
(-some-> (frame-parameter frame 'company-box-doc-frame)
(make-frame-invisible))
(when (timerp company-box-doc--timer)
(cancel-timer company-box-doc--timer))
(setq company-box-doc--timer
(run-with-timer
company-box-doc-delay nil
(lambda nil
(company-box-doc--show selection frame)
(company-ensure-emulation-alist))))))
Now the doc popup faster, feels same fast as other candidates on first candidate. Confirmed. Thanks for solution.
Thanks for testing @stardiviner @seagle0128. I will use run-with-timer
Cool~~~ Thank you! @sebastiencs
@sebastiencs Any update?
@seagle0128 Done
@sebastiencs Thank you! It does work.
I needed to change it here too: https://github.com/sebastiencs/company-box/blob/766546b2668b5ef4eb4abbde632c9acd370c7788/company-box.el#L998 (which was added by PR #119 which has been opened before https://github.com/sebastiencs/company-box/commit/8f33f8189bebbce4bd7da2d0fc5d2528bc2f683c but merged afterward).
I can open PR if you like.
run-with-idle-timer
causes the delay of displaying doc at the first candidate. It works after moving up or down. I test withrun-with-timer
, and it seems working but I am not sure if there is side-effect.https://github.com/sebastiencs/company-box/blob/20384f0e382c063173b9d863344b1b23bc1e4954/company-box-doc.el#L137