Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FloatingWindow feature requests #1

Closed
prabirshrestha opened this issue Jan 9, 2021 · 12 comments
Closed

FloatingWindow feature requests #1

prabirshrestha opened this issue Jan 9, 2021 · 12 comments

Comments

@prabirshrestha
Copy link

prabirshrestha commented Jan 9, 2021

Looking into adding floating window support in vim-lsp. prabirshrestha/vim-lsp#1033

And seems like few features are missing.

  1. support for z-index
  2. events for on_create, on_close. this allows to easily add custom events or autocmd for us
  3. borders support
  4. Scroll Vim8 popup scroll prabirshrestha/vim-lsp#1025
@hrsh7th
Copy link
Owner

hrsh7th commented Jan 10, 2021

I'm now thinking of FloatingWindow...

  1. The VS.Vim.Window.FloatingWindow as more primitive
  • Don't create any buffer but receive it from the user.
  • Don't provide maxheight/maxwidth
  1. We should introduce VS.Vim.Window.Widget.* (the first candidate is `tooltip? hover? info? hint?)
  • It supports borders and scroll target.

The on_create/on_close is reasonable. I will add it.

@prabirshrestha
Copy link
Author

I would also vote for making floating window more primitive as possible. I have shared some of my thoughts here. vim-jp/vital.vim#747 and vim-jp/vital.vim#748.

The way I think of if the primitive popup is only to normalize the apis between vim and neovim.

I would then want a PopupManager which is completely different from the primitive popup and is primarily responsible for setting the right height and position.

Similar to how callbag is solving async and callbacks issues, I was separately working on the popup to support it.

I'm ok not removing max/min width because sometimes that can be used to easily create a popups though vim-lsp might not use it as the PopupManager would be in control of the position as well as width/height.

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 17, 2021

  1. support for z-index

  2. events for on_create, on_close. this allows to easily add custom events or autocmd for us

  3. borders support

  4. Scroll Vim8 popup scroll prabirshrestha/vim-lsp#1025

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 17, 2021

The scroll methods can be used without VS.Vim.Window.FloatingWindow.
It was designed as can be used with a Normal window.

@prabirshrestha
Copy link
Author

Seems like pos is not configurable.

I did implement this in my version of popup.vim.
https://github.com/vim-jp/vital.vim/pull/748/files#diff-38ecd4c22c7dc649baefaf3fc2ae524fb39d44a061defae3db905457d5890507R176-R194

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 18, 2021

It's reasonable. I will add it.

I'm dogfooding with FloatingWindow now.

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 20, 2021

Seems like pos is not configurable.

I've implemented as origin option that accepts as same as you implemented one.

@prabirshrestha
Copy link
Author

Thanks for the impl. Would also need zindex support to help with this issue. prabirshrestha/vim-lsp#1049 I'm hoping to have something like let g:lsp_documentation_popup_zindex = 100

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 21, 2021

But neovim's floating window has no zIndex option...

IMO, we shouldn't show floating-window as overlapping the completion-menu.

@prabirshrestha
Copy link
Author

that makes sense. i would prefer not to support z-index for now.

@hrsh7th
Copy link
Owner

hrsh7th commented Feb 28, 2021

I'm considering border & padding.

@hrsh7th
Copy link
Owner

hrsh7th commented May 30, 2021

@prabirshrestha I've implemented simple border supports.

We can pass 'border': v:true to s:win.open().

@hrsh7th hrsh7th closed this as completed May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants