simplified λ prompt in lua (#1693)

* replace lambda with $

* simplified $ prompt

The $ character for the prompt is defined only once instead of twice

* fixed λ prompt
This commit is contained in:
David Refoua 2018-03-08 14:31:48 +03:30 committed by Martin Kemp
parent 8237b1010c
commit ff2e09849e

8
vendor/clink.lua vendored
View File

@ -40,12 +40,10 @@ local function set_prompt_filter()
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m -- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
-- color codes: "\x1b[1;37;40m" -- color codes: "\x1b[1;37;40m"
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m" local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
local lambda local lambda = "λ"
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd) cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
if env == nil then if env ~= nil then
lambda = "λ" lambda = "("..env..") "..lambda
else
lambda = "("..env..") λ"
end end
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda) clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
end end