tumashu / company-posframe

121 stars 24 forks source link

Bugs fix and feature request #28

Closed MeltWS closed 4 years ago

MeltWS commented 4 years ago

First of all I want to say thanks for this package, it works well as a child frame alternative to company popup, which is quite usefull, and is not too slow like some alternative are.

that said, if I may give a list of some things I found out are not working for me, or that could be nice to improve.

bugs

Some things that could be improved

tumashu commented 4 years ago
I can overwritte binds, but they won't work during the completion.
For example when trying to rebind the toggle help function to an ununsed keybind, it will not call the function when the keys are pressed.

I tested with

(define-key company-posframe-active-map (kbd "<f4>") 'company-posframe-quickhelp-toggle)

, seem to work

tumashu commented 4 years ago
in company-posframe-quickhelp-show-params not all posframe supported options are working
if my understanding is correct, it should be possible to use foreground-color or background-color directly.
They are alternatives like setting a face but it seems posframe should be able to handle thoses directly?

background-color and foreground-color are controled by company-posframe-quickhelp face

tumashu commented 4 years ago
 having a max-height max-width setting for quickhelp
I tried writing something but the result was very unsatisfying. The quickhelp frame is drawn where the precedent was, which leads to issues when increasing the size. It seems like this would take a bit of effort, to get something good would require better positional handling of the frame.

the real problem is doc's hight and width, you can try and pr :-)

tumashu commented 4 years ago
an option to offset the quickhelp

customize company-posframe-quickhelp-show-params's :poshandler is right thing :-) If you think your poshandler is better than default, just pr and change default poshandler

MeltWS commented 4 years ago
(define-key company-posframe-active-map (kbd "<f4>") 'company-posframe-quickhelp-toggle)

, seem to work

Doesn't work for me, if I bind an unbound key to company-posframe-active-map and I try using it during completion, it just prompt for undefined it's like the keymap is inactive. Using which-key confirms company-posframe-active-map exist and I can override binds correctly.

As a workaround I tried binding directly in company-active-map it works as long as I call directly company-posframe functions. I can't get it to work if I call them from a custom function ie

(defun my-company-posframe-quickhelp-toggle ()
  (interactive)
    (company-posframe-quickhelp-toggle) ;; Doesn't work
    )

I don't know how to debug why complany-posframe-active-map doesn't activate during completion

I tried debuging for the workaround, it seems to make the correct call to posframe-funcall to check if the quickhelp frame is visible but when called using custom function, it always returns the frame is hidden, so something is happening to the frame before that I guess.

MeltWS commented 4 years ago
 having a max-height max-width setting for quickhelp
I tried writing something but the result was very unsatisfying. The quickhelp frame is drawn where the precedent was, which leads to issues when increasing the size. It seems like this would take a bit of effort, to get something good would require better positional handling of the frame.

the real problem is doc's hight and width, you can try and pr :-)

Here is what I meant when I said the positioning has to be changed This looks fine ![image](https://user-images.githubusercontent.com/15630634/74189625-0b11cf80-4c51-11ea-96ea-7c6b2cbc1e09.png) Now when we hit the bottom of the frame, the quickhelp is pushed up wich is good. ![image](https://user-images.githubusercontent.com/15630634/74189761-4a402080-4c51-11ea-8879-5bc2489e88b9.png) Now keep scrolling the list of candidate and making new quickhelp tooltip ![image](https://user-images.githubusercontent.com/15630634/74189938-a30fb900-4c51-11ea-8320-80302064b2c5.png) The new quickhelp is drawn at the same starting position of the previous one, but this one doesn't need to be pushed up
tumashu commented 4 years ago
Doesn't work for me, if I bind an unbound key to company-posframe-active-map and I try using it during completion, it just prompt for undefined it's like the keymap is inactive.
Using which-key confirms company-posframe-active-map exist and I can override binds correctly.

Try to reinstall company to new version

MeltWS commented 4 years ago

Try to reinstall company to new version

Reinstalling company related packages worked thanks.