This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
Enabling sections for specific filetypes #206
-
I am trying to get asyncrun status in quickfix window statusline. However, I am not able to get it with following code. How should I modify the components.inactive[2][1] = {
provider = "Code Status:" .. '%{g:asyncrun_status}',
enabled = vim.fn.exists('g:asyncrun_status') and print(vim.bo.filetype) == 'qf',
hl = {
fg = 'black',
bg = 'cyan',
style = 'bold'
},
left_sep = {
str = ' ',
hl = {
fg = 'NONE',
bg = 'cyan'
}
},
right_sep = {
{
str = ' ',
hl = {
fg = 'NONE',
bg = 'cyan'
}
},
' '
}
}
|
Beta Was this translation helpful? Give feedback.
Answered by
lukas-reineke
Jan 23, 2022
Replies: 1 comment
-
The way you have it, it gets evaluated just once when you start Neovim. Instead, you want to make enabled = function()
return vim.g.asyncrun_status ~= nil and vim.bo.filetype == 'qf'
end |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RayZ0rr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way you have it, it gets evaluated just once when you start Neovim. Instead, you want to make
enabled
a function, that returns a boolean.Also, your usage of
print
is wrong, and you don't need to usevim.fn.exists