mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-14 07:29:12 +08:00
Fix global Lua namespace pollution.
Some variables were global when the intent was to be local variables.
This commit is contained in:
parent
74381ecd19
commit
c9153c96bf
6
vendor/clink.lua
vendored
6
vendor/clink.lua
vendored
@ -151,12 +151,12 @@ local function set_prompt_filter()
|
|||||||
cwd = string.gsub(cwd, clink.get_env("HOME"), prompt_homeSymbol)
|
cwd = string.gsub(cwd, clink.get_env("HOME"), prompt_homeSymbol)
|
||||||
end
|
end
|
||||||
|
|
||||||
uah = ''
|
local uah = ''
|
||||||
if prompt_useUserAtHost then
|
if prompt_useUserAtHost then
|
||||||
uah = clink.get_env("USERNAME") .. "@" .. clink.get_env("COMPUTERNAME") .. ' '
|
uah = clink.get_env("USERNAME") .. "@" .. clink.get_env("COMPUTERNAME") .. ' '
|
||||||
end
|
end
|
||||||
|
|
||||||
cr = "\n"
|
local cr = "\n"
|
||||||
if prompt_singleLine then
|
if prompt_singleLine then
|
||||||
cr = ' '
|
cr = ' '
|
||||||
end
|
end
|
||||||
@ -170,7 +170,7 @@ local function set_prompt_filter()
|
|||||||
|
|
||||||
local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""
|
local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""
|
||||||
|
|
||||||
prompt = "{uah}{cwd}" .. version_control .. cr .. get_lamb_color() .. "{env}{lamb}\x1b[0m "
|
local prompt = "{uah}{cwd}" .. version_control .. cr .. get_lamb_color() .. "{env}{lamb}\x1b[0m "
|
||||||
prompt = string.gsub(prompt, "{uah}", uah)
|
prompt = string.gsub(prompt, "{uah}", uah)
|
||||||
prompt = string.gsub(prompt, "{cwd}", cwd)
|
prompt = string.gsub(prompt, "{cwd}", cwd)
|
||||||
prompt = string.gsub(prompt, "{env}", env)
|
prompt = string.gsub(prompt, "{env}", env)
|
||||||
|
Loading…
Reference in New Issue
Block a user