rmagatti / goto-preview

A small Neovim plugin for previewing definitions using floating windows.
Apache License 2.0
835 stars 27 forks source link

[FEATURE] Configurable starting zindex #118

Closed MisanthropicBit closed 3 months ago

MisanthropicBit commented 4 months ago

Is your feature request related to a problem? Please describe. goto-preview uses a hardcoded zindex for floating windows starting from 1 and increasing with the number of windows, making it hard to adjust it to play well with other plugins. Although I can configure the default zindex of other plugins, I can't make it lower than goto-preview's zindex as they must larger than zero.

This happened specifically for incline.nvim which uses a default zindex of 50 so that its floating windows will always appear on top of goto-preview's floating windows (except for the 51th+ floating window).

Describe the solution you'd like I would like to be able to configure a starting zindex that can grow from there. I can submit a PR if you want since it should be pretty easy to support.

Describe alternatives you've considered In this case, I could set incline.nvim's zindex to 1 but if I have other plugins that need a specific stacking order below goto-preview, I don't have enough of a range to support it. I've set goto-preview's starting zindex to 51 in my local copy and it seems to work.

Additional context In case you don't use incline, the issue is the small window with the lua logo and the text "init.lua" in line 9 of the floating window.

image
rmagatti commented 4 months ago

Thanks for the issue submission. A configurable zindex sounds like a good idea. I'll try to get to this whenever I get some free time, otherwise I'd welcome a PR!

MisanthropicBit commented 4 months ago

Glad to hear it. I've gotten started on a PR (#119) and I'll test it out when I get some more time.

Thanks for the plugin and quick response. I use it daily 🙂

rmagatti commented 3 months ago

119 is merged 🎉