Closed dgutov closed 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.
@dgutov how to enable icon in margin?
@tumashu
(setq company-format-margin-function #'company-vscode-light-icons-margin)
company-dabbrev-code
, company-yasnippet
, lsp-mode
or (if you build Emacs from master) emacs-lisp-mode
. 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.
maybe we can introduce :poshandler-extra-info to posframe-show, with this argument help, we can pass any info to poshandler function.
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 Looking good, thanks!
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.