Skip to content

add support for floating window and popup #747

Open
@prabirshrestha

Description

@prabirshrestha

It would be good if vital.vim has a popup api that works in both vim and neovim. There has been some PRs related to this in vim-lsp at prabirshrestha/vim-lsp#510 and prabirshrestha/vim-lsp#567. Another one i found was this https://github.com/ZSaberLv0/ZFVimPopup. Lot of other plugins also has to keep creating wrappers to solve this issue.

Besides just a wrapper around vim and neovim apis there are other high level apis that would be necessary for the popup such as controlling direction and zindex. For example I might want to show LSP hover information above the cursor but diagnostics below the cursor. If autocomplete popup menu is open I might want to show the popup at the right of the complete menu but if it is to the end of the screen i might want to show it to the left instead or if at the bottom of the screen i might want to show at the top. Or might even want to dock it similar as https://github.com/ncm2/float-preview.nvim. Might also want to listen to buffer/window resizes and resize accordingly.

Since some of these are quite complicated specially when dealing with multiple popup at the same time my thought was to have 2 modules.

  1. Popup : This is a simple wrapper that is just bridges vim popup and neovim floating window apis.
  2. PopupManager: This is the bigger one which does the management of multiple popups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions