galaxyline.nvim
galaxyline.nvim copied to clipboard
Check if telescope is running
Hello,
I have a special Statusline only when NvimTree is open. I check for
vim.bo.filetype == "NvimTree"
inside a condition of a short line component
I would like to have the same with telescope, but telescope does not change the filetype. Does anyone know to check with lua if telesope is running?
@Tummetott iirc Telescope does change the filetype to TelescopePrompt
.
Are you sure? For me it does not change the filetype at all 😑
@Tummetott might want to file a bug report upstream because its showing up for me.
Ok thanks I’ll investigate further
I checked and Telescope is indeed setting the correct fileype. However I'm not able to get a special statusline only for Telescope. It's working for Packer, Nvimtree and others but not for Telescope.
I have the following code:
local gl = require("galaxyline")
local gls = gl.section
gl.short_line_list = { 'NvimTree', 'packer', 'TelescopePrompt' }
gls.short_line_left[1] = {
Telescope = {
condition = function()
return vim.bo.filetype == "TelescopePrompt"
end,
provider = function()
return "TELESCOPE"
end,
highlight = {"#FF0000", "#00FF00"},
}
}
But It's not working. Has anyone a working example?
@Tummetott I don't know, but after playing around with your code, I found out something interesting.
If I open the nvim-tree (the file explorer), and enable the statusline there, now whenever I open/close the Telescope, the TELESCOPE text does toggle over there, but delayed.
So I guess, because the focus already "leave", so it does not update the statusline in the buffer?
Sorry if I cause any confusion. I'm totally new in this area.