fixing branch only

This commit is contained in:
dgames 2021-05-30 07:27:16 -04:00
parent 8d6ce3e4ac
commit 03d0f913ea
2 changed files with 15 additions and 0 deletions

14
vendor/clink.lua vendored
View File

@ -350,6 +350,7 @@ local function git_prompt_filter()
clean = clean_color,
dirty = dirty_color,
conflict = conflict_color
nostatus = unknown_color
}
local git_dir = get_git_dir()
@ -377,6 +378,17 @@ local function git_prompt_filter()
return false
end
end
else
if git_dir then
local branch = get_git_branch(git_dir)
local color
if branch then
color = colors.nostatus
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..verbatim(branch)..")")
return false
end
end
end
-- No git present or not in git file
@ -394,6 +406,7 @@ local function hg_prompt_filter()
local colors = {
clean = clean_color,
dirty = dirty_color,
nostatus = nostatus_color
}
local pipe = io.popen("hg branch 2>&1")
@ -428,6 +441,7 @@ local function svn_prompt_filter()
local colors = {
clean = clean_color,
dirty = dirty_color,
nostatus = nostatus_color
}
if get_svn_dir() then

View File

@ -43,3 +43,4 @@ lamb_color = "\x1b[1;30;40m" -- Light Grey = Lambda Color
clean_color = "\x1b[1;37;40m"
dirty_color = "\x1b[33;3m"
conflict_color = "\x1b[31;1m"
unknown_color = "\x1b[1;30;40m" -- Light Grey = No VCS Status Branch Color