galaxyline.nvim icon indicating copy to clipboard operation
galaxyline.nvim copied to clipboard

Check if telescope is running

Open tummetott opened this issue 3 years ago • 6 comments

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 avatar May 08 '21 22:05 tummetott

@Tummetott iirc Telescope does change the filetype to TelescopePrompt.

ram02z avatar May 09 '21 01:05 ram02z

Are you sure? For me it does not change the filetype at all 😑

tummetott avatar May 09 '21 08:05 tummetott

@Tummetott might want to file a bug report upstream because its showing up for me. image

ram02z avatar May 09 '21 12:05 ram02z

Ok thanks I’ll investigate further

tummetott avatar May 09 '21 19:05 tummetott

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 avatar May 10 '21 18:05 tummetott

@Tummetott I don't know, but after playing around with your code, I found out something interesting.

telescope

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.

sangdth avatar May 27 '21 08:05 sangdth