mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
Refactor the env substution logic
And some prompt cleanup
This commit is contained in:
parent
8d6ce3e4ac
commit
e8df3ef247
13
vendor/clink.lua
vendored
13
vendor/clink.lua
vendored
@ -83,14 +83,13 @@ local function set_prompt_filter()
|
||||
cr = ' '
|
||||
end
|
||||
|
||||
if env ~= nil then
|
||||
prompt_lambSymbol = "("..env..") "..prompt_lambSymbol
|
||||
end
|
||||
if env ~= nil then env = "("..env..") " else env = "" end
|
||||
|
||||
prompt = uah_color .. "{uah}" .. cwd_color .. "{cwd}{git}{hg}{svn}" .. lamb_color .. cr .. "{lamb} \x1b[0m"
|
||||
uah_value = string.gsub(prompt, "{uah}", uah)
|
||||
new_value = string.gsub(uah_value, "{cwd}", cwd)
|
||||
clink.prompt.value = string.gsub(new_value, "{lamb}", prompt_lambSymbol)
|
||||
prompt = uah_color .. "{uah}" .. cwd_color .. "{cwd}{git}{hg}{svn}" .. lamb_color .. cr .. "{env}{lamb} \x1b[0m"
|
||||
prompt = string.gsub(prompt, "{uah}", uah)
|
||||
prompt = string.gsub(prompt, "{cwd}", cwd)
|
||||
prompt = string.gsub(prompt, "{env}", env)
|
||||
clink.prompt.value = string.gsub(prompt, "{lamb}", prompt_lambSymbol)
|
||||
end
|
||||
|
||||
local function percent_prompt_filter()
|
||||
|
Loading…
Reference in New Issue
Block a user