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

Open window callback #142

Closed
stellarhoof opened this issue Aug 29, 2020 · 1 comment
Closed

Open window callback #142

stellarhoof opened this issue Aug 29, 2020 · 1 comment
Labels

Comments

@stellarhoof
Copy link

Is your feature request related to a problem? Please describe.
I want to display a custom floating window

Describe the solution you'd like
A callback which leaves all window-opening details to the user

Here's a function I use to open a window with borders (among other things): neovim/neovim#9718 (comment). I can use it with fzf.vim like let g:fzf_layout = {'window': 'call core#centered_floating_window(v:true)'}. I'd love if I could reuse that function with this library. In fact, that'd allow much more flexibility than the current *g:which_key_floating_opts* option.

Thanks!

@rene-descartes2021
Copy link
Collaborator

rene-descartes2021 commented Nov 30, 2022

Looking at that linked comment, looks like this specific use-case had to do with adding a border to Neovim. Which appears to have since been added via the border field of the {opts} parameter of nvim_open_win().

Doesn't look like g:fzf_layout is in fzf.vim anymore.

I think it's an interesting pattern to explore, a callback to allow the consumer to set up constraints on the window location/layout which the plugin will then fill in. Perhaps for someone else to explore and advocate for, beyond the scope of vim-which-key. EDIT: One suggestion would be to support the extension of Shougo's line of work with the UI framework ddu.vim, all sorts of possibilities.

What is left is essentially duplicate with #180 so closing this.

I'll probably add something similarly named to g:which_key_floating_opts to allow setting {opts} fields explicity on the window creation function, which would fix #210, and also permit changing the border. Related is vim-clap's approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants