mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	Refactor the env substution logic
And some prompt cleanup
This commit is contained in:
		
							
								
								
									
										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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user