We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if im not in a git repo, the branch is just disabled
i came with this workaround:
lualine_b = { { function() local is_git = vim.fn.system("git rev-parse --is-inside-work-tree") if is_git and vim.v.shell_error == 0 then return vim.fn.system("git branch --show-current | tr -d '\n'") end return "ungit" end, icon = icons.git.Branch, padding = { left = 2, right = 1 }, }, },
which gets me the branch name or ungit but it take too much time to update, like around a few secs after neovim startup which i do not want...
branch name
ungit
or if the git branch is taking too much time, is there any way to return the component branch from a function?
git branch
return
branch
The text was updated successfully, but these errors were encountered:
You can use fmt option to overwrite result of the component based on component output
fmt
{'branch', fmt=function(str) return str ~= '' and str or 'ungit' end},
this should pretty much do what you want.
Sorry, something went wrong.
You can use fmt option to overwrite result of the component based on component output {'branch', fmt=function(str) return str ~= '' and str or 'ungit' end}, this should pretty much do what you want.
hi thanks for this, i was racking my brains too hard not to see a simple solution like this, CHEERS! 🥂
No branches or pull requests
Requested feature
if im not in a git repo, the branch is just disabled
i came with this workaround:
which gets me the
branch name
orungit
but it take too much time to update, like around a few secs after neovim startup which i do not want...or if the
git branch
is taking too much time, is there any way toreturn
the componentbranch
from a function?The text was updated successfully, but these errors were encountered: