flirt.nvim
flirt.nvim copied to clipboard
Bug: flirt breaks some Telescope & Dressing windows, even when excluded
In particular, for TelescopePrompt and DressingInput flirt does break functionality by hiding/obfuscating text in some (but not all) cases. Adding these to the list of excluded files does not seem to make a difference – both filetypes are not ignored, meaning the animations and the bugs persist.
Example for :Telescope git_branches with and without the plugin:
Another plugin, whose window gets broken by flirt, is ccc, but here adding the respective filetype (ccc-ui) does seem to successfully ignoring the filetype.
Heyyo @chrisgrieser,
Actually this is a known issue 😭 .
The thing is, telescope and others actually go like: buf_create() -> open_win() -> set_filetype()
Whereas it should have been: buf_create() -> set_filetype() -> open_win()
So there are 2 possible options to mitigate this as per my knowledge:
-
I should make a contribution to these repos stating the obvious. Might be a tedious work and might break some of that plugins functionality.
-
This is the cleanest way: Plugin maintainers exposing the
zindexvalue of the float option. For example, if telescope exposed this option, i could set it in my telescope config (say something like value 69). Then in flirt I could filter that zindex value. (Or plugin maintainers can give the floats a custom fixed value which would make everything easier.)
This is from nvim_open_win()s doc:
• zindex: Stacking order. floats with higher `zindex` go on top on floats with lower indices. Must be larger
than zero. The following screen elements have hard-coded z-indices:
• 100: insert completion popupmenu
• 200: message scrollback
• 250: cmdline completion popupmenu (when
wildoptions+=pum) The default value for floats are 50.
In general, values below 100 are recommended, unless
there is a good reason to overshadow builtin elements.
Here is a telescope issue regarding zindices: https://github.com/nvim-telescope/telescope.nvim/issues/1926
@chrisgrieser , What do you think should be done? Or do you have a better idea? 🤔
hmmm, yeah, that's tricky. I guess I would just attempt to suggest solutions at the respective plugin's repos, and see whichever the maintainers see as most fit for their situation?
otherwise, I am wondering whether there is something flirt can do to be usable for users even if a plugin defines its filetypes in that way. Could some sort of whitelisting floats instead of blacklisting be of help here maybe? 🤔
suggest solutions at the respective plugin's repos, and see whichever the maintainers see as most fit for their situation?
Hmm yes it would be great if all plugins exposed this kind of option. In fact, the zindex option is the only option as of now that can differentiate different popups so it would make more sense if they fixed one for their floats.
Could some sort of whitelisting floats instead of blacklisting be of help here maybe?
I have thought about this before but it should be configurable by the user right? 🤔
I have thought about this before but it should be configurable by the user right? 🤔
yeah. But since this plugin has the tendency to break things, it'd be to set a default whitelist where only plugins are added that have been confirmed to not break.
But since this plugin has the tendency to break things, it'd be to set a default whitelist where only plugins are added that have been confirmed to not break.
Agreed 💯 .
But the thing is some floats (most) does not have some unique property (not even filetype). For example, diagnostic float, hover floats, also most plugins might open it in scratch mode so we cant differentiate them. That would mean we would only have a handful amount of plugins in the white list.