Revert "sanitize dir before assigning to prompt"

This reverts commit 0b2d7bd655.
This commit is contained in:
Benjamin Staneck 2018-06-07 17:04:06 +02:00
parent 0b2d7bd655
commit 6c016788d4

9
vendor/clink.lua vendored
View File

@ -41,13 +41,6 @@ local function set_prompt_filter()
-- 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 = "λ"
local function sanitize_dir(str)
str = string.gsub(str, "+", " ")
str = string.gsub(str, "%%(%x%x)", function(h) return string.char(tonumber(h,16)) end)
str = string.gsub(str, "\r\n", "\n")
return str
end
cmder_prompt = sanitize_dir(cmder_prompt)
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 = "("..env..") "..lambda lambda = "("..env..") "..lambda
@ -242,7 +235,7 @@ end
-- Get the status of working dir -- Get the status of working dir
-- @return {bool} -- @return {bool}
--- ---
local function get_svn_status() function get_svn_status()
local file = io.popen("svn status -q") local file = io.popen("svn status -q")
for line in file:lines() do for line in file:lines() do
file:close() file:close()