nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

Execute custom code when opening the documentation window

Open apazzolini opened this issue 3 years ago • 0 comments

Is there a way to execute custom code against the documentation window? Specifically, I would love to be able to use nvim-colorizer.lua in the documentation window, which would be really useful in conjunction with the Tailwind language server.

It seems that having an autocmd for FileType * doesn't get invoked inside of the documentation popup. Maybe this is because filetype is unset for the popup?

If I add the following line after the self.window:open(style) call in cmp/view/docs_view.lua:100, I get the behavior in the subsequent GIF:

require('colorizer').attach_to_buffer(self.window:get_buffer())

I'd be happy to contribute code for this if you could provide guidance on the API you'd like. Thank you!

Screen Recording 2022-07-18 at 11 01 03 PM

apazzolini avatar Jul 19 '22 04:07 apazzolini