Skip to content

Commit 586e94a

Browse files
committed
fix(statusline): Fixed a bug with not getting a branch causing errors
1 parent 8c43622 commit 586e94a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/bars/components/statusline.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ slC.branch = function (_, window, main_config)
339339
end
340340
end
341341

342-
if branch[1]:match("^fatal%:") then
342+
if not branch or vim.tbl_isempty(branch) then
343+
return "";
344+
elseif branch[1]:match("^fatal%:") then
343345
return "";
344346
elseif branch[1]:match("^error%:") then
345347
return "";

0 commit comments

Comments
 (0)