levouh/tint.nvim

[Bug] Telescope prompt buffer cannot be ignored

akinsho opened this issue · 2 comments

Hi @levouh

This is a really cool plugin/use of window highlights.

Just trying it out and noticed that it seemed to influence my telescope prompt buffer even after adding Telescope* to the highlights to ignore and trying to exclude floating windows using

 if vim.fn.win_gettype(vim.api.nvim_win_get_number(win_id)) ~= '' then return true end

--- and
if vim.api.nvim_win_get_config(window).relative ~= '' then return true end

image

(The dark shading in the prompt buffer is the anomaly, it shouldn't be there)

I believe at the time that WinEnter and WinLeave have been executed, buffer options won't necessarily have been executed yet. I'm not sure how Telescope handles laying out windows, but not particular mixture of blockages/ignoring seems to prevent this window from being affected, I think this may affect some other floating windows but limiting the issue to the easiest to observe for me.

Thanks @akinsho!

I will mess around with it and see if I can find a simple way to fix it. I imagine though that just exposing tint and untint functions might be the easiest route - as then you can just call untint (hopefully without a flicker) in a TelescopePrompt autocmd.

Let me know what you think of that as a solution whilst I take a look.

I think the cause might be an autocommand issue, i.e. about when certain values are set. I wonder if on WinEnter if you checked if a window was a float if it would be true although tbh so many things are happening in telescope it wouldn't surprise me if maybe it opens and closes windows quickly or something.

Although in general it might be a good idea to ignore all floats because I've noticed that this also dims lsp doc windows since they don't have focus which isn't really useful since you need to read them, and they don't really have a file type to access easily