tumashu / company-posframe

121 stars 24 forks source link

company--create-lines return value changed #52

Closed dgutov closed 3 years ago

dgutov commented 3 years ago

Hi!

Please be aware that I've just changed the return value of this function to (COLUMN-OFFSET . LINES) in company-mode master.

Should be easy to detect this version: just check whether the car of the list is a number, and if so, use its cdr.

dgutov commented 3 years ago

@tumashu Thank you, that seems to work.

Another thing you might want to change (which will require a less trivial rearrangement), if positioning of the tooltip when icons are shown: it is now off by 1 column.

The COLUMN-OFFSET value contains the necessary offset, to be used in company-posframe-show-at-prefix instead of company-tooltip-margin, but I'm not sure how to get it there best.

tumashu commented 3 years ago

@dgutov how to enable icon in margin?

dgutov commented 3 years ago

@tumashu

tumashu commented 3 years ago

Should be fixed. https://github.com/tumashu/company-posframe/commit/26d15ab77f61a089299d739c83ba648cdc36ca0d

dgutov commented 3 years ago

Working well, thank you.

I though it would be easy to pass the extra offset lexically through some arg (:position, perhaps), but it seems that would run counter to the reason company-posframe-poshandler was introduced.

tumashu commented 3 years ago

maybe we can introduce :poshandler-extra-info to posframe-show, with this argument help, we can pass any info to poshandler function.

dgutov commented 3 years ago

That should work, yes. Maybe pass an alist with 3 values: current pos, company-prefix length, and margin offset. The handler should be able to decide based on them.

Nothing urgent, though, so whenever you have the time to experiment.

tumashu commented 3 years ago

@dgutov fixed. https://github.com/tumashu/company-posframe/commit/a28f38213a2a30ce68fdb0b124cadc68ebbcb24f

dgutov commented 3 years ago

@tumashu Looking good, thanks!