Set different element active and inactive window
sphynx79 opened this issue · comments
Sphynx commented
gegoune commented
I think you can check if status line is being drawn for current window in your generator function. TJ will probably know exactly how to do that or if there is better way. Only reason I am saying this is because I draw different status line for various filetypes and I have such conditional in may generator function:
if ft ~= 'man' and (bufhidden ~= '' or bufhidden == 'wipe' or buftype == 'nofile') then
return {
-- 'short' status line here
}
end
YIQUN commented
I found a way to check if the current window is focused or not:
if win.win_id ~= vim.api.nvim_get_current_win() then
--- not active
else
--- active
end
the variable win
is passed to every segment function by express_line