alexmurray / flycheck-posframe

Show flycheck errors via posframe.el
60 stars 9 forks source link

Don't show while auto-completion #12

Closed seagle0128 closed 5 years ago

seagle0128 commented 5 years ago

Thanks for the great package!

I have an issue while input with company. When auto-completion popup, the flycheck-posframe still popups, which overrides the company prompts. I think it should not display while auto-completion popups.

image

alexmurray commented 5 years ago

I can't reproduce this - it looks like you are using company-box - but even with that enabled I don't see this. Can you provide any more details how to reproduce it?

seagle0128 commented 5 years ago

Thanks for the reply!

I think it's not related to company-box. I was trying to reproduce with vanilla Emacs, and found it occurred with python-mode, flycheck-mode, company-mode and lsp-mode. Attached the recording below.

emacs

alexmurray commented 5 years ago

Thanks - ok I have managed to reproduce it... I have just added a generic interface d1591cf which should allow you to relatively easily avoid this - with the latest git master you should be able to do the following:

(add-to-list 'flycheck-posframe-inhibit-functions #'(lambda () company-backend)

Which will inhibit display of flycheck-posframe whenever company-backend is non-nil (which it is when company completion is active from what I can see).

Let me know what you think.

seagle0128 commented 5 years ago

Perfect! It does work for me.

Suggest to make it as default value: (lambda () (bound-and-true-p company-backend)).

sethen commented 1 year ago

@alexmurray Any chance you can help me to do the same thing for corfu? lol

sethen commented 1 year ago

@alexmurray Actually with some playing I found out that corfu--candidates variable did the trick. Same thing as company-backends but corfu specific.

alexmurray commented 1 year ago

@sethen how about the following (untested):

(add-to-list 'flycheck-posframe-inhibit-functions #'(lambda () (and (bound-and-true-p corfu-mode) (bound-and-true-p completion-in-region-mode))))