Open ddovod opened 8 years ago
This is going to be really hard to fix; the other menu is from autocomplete, right? I don't think there's a way for us to autodetect its width, so we'd have to have a special case for every package that displays a menu (company, ac, ...)
Of course, I'm hoping @lunaryorn to prove me wrong :)
I tend to agree with @cpitclaudel: I don't think that we can easily prevent this sort of thing. I'm inclined to close this issue was "wontfix".
At best, we could provide an option to adjust tooltip placement, but I'm not firm enough with pos-tip to implement that.
I'm having the exact same problem, but since I only manually complete I'd be happy with a way to disable the pos-tip when the completion menu is showing. Any ideas how to accomplish this?
@ambihelical You can remap the command that starts completion to a defun
of your own that would call pos-tip-hide
before calling through to the completion function. I can give more details if needed :)
I tried it but it doesn't completely solve the problem, as flycheck can cause the tooltip to reappear while the completion menu is still showing. I will probably look into temporarily disabling flycheck next, as there seems to be hooks for completion start and stop.
A potentially simple way to fix this for everyone would be if there was an option to always place the tooltip above the line, and then the two popups shouldn't interfere.
call
pos-tip-hide
before calling through to the completion function
I think it's a good solution.
@seagle0128 Did it work for you? It's been awhile but as I said, it seem to be possible for pos-tip-show to be called again while the completion menu is still active, and I seem to recall this occurring during my experiments.
I ended up doing the following, it has worked so far for me, but requires saving and restoring the flycheck-pos-tip-error-messages function, which seems a bit of a hack to me.
Partial config follows.
(use-package company
:init
(add-hook 'company-completion-started-hook #'me:company-started)
(add-hook 'company-completion-finished-hook #'me:company-ended)
(add-hook 'company-completion-cancelled-hook #'me:company-ended)
:config
(defvar me:flycheck-error-function nil)
(defun me:company-started (&optional args)
(when (fboundp 'flycheck-pos-tip-error-messages)
(setq me:flycheck-error-function (symbol-function 'flycheck-pos-tip-error-messages))
(fset 'flycheck-pos-tip-error-messages 'ignore)))
(defun me:company-ended (&optional args)
(when (fboundp 'flycheck-pos-tip-error-messages)
(fset 'flycheck-pos-tip-error-messages me:flycheck-error-function))))
@ambihelical Honestly I didn't try this workaround. But it seems your workaround works as well.
Thanks for sharing that. I think we should have an API to temporarily suspend Flycheck. It turns out that autocomplete already uses advice to override an internal function and disable Flycheck while completing, so that API would be useful there too.
Hi. I have some issue with tooltip. Instead of thouthand words please look at the picture http://imgur.com/w2Daspa
Is there any solution? Thank you a lot!