mirror of
				https://github.com/oh-my-fish/theme-bobthefish.git
				synced 2025-06-13 13:03:54 +00:00 
			
		
		
		
	Get rid of the last $__bobthefish_* global!
This commit is contained in:
		
							parent
							
								
									c2b313408c
								
							
						
					
					
						commit
						6ca1ae9246
					
				| @ -25,8 +25,6 @@ | |||||||
| #     set -g theme_avoid_ambiguous_glyphs yes | #     set -g theme_avoid_ambiguous_glyphs yes | ||||||
| #     set -g default_user your_normal_user | #     set -g default_user your_normal_user | ||||||
| 
 | 
 | ||||||
| set -g __bobthefish_current_bg NONE |  | ||||||
| 
 |  | ||||||
| # =========================== | # =========================== | ||||||
| # Helper methods | # Helper methods | ||||||
| # =========================== | # =========================== | ||||||
| @ -123,21 +121,21 @@ function __bobthefish_start_segment -S -d 'Start a prompt segment' | |||||||
|   set_color normal # clear out anything bold or underline... |   set_color normal # clear out anything bold or underline... | ||||||
|   set_color -b $bg |   set_color -b $bg | ||||||
|   set_color $fg $argv |   set_color $fg $argv | ||||||
|   if [ "$__bobthefish_current_bg" = 'NONE' ] | 
 | ||||||
|     # If there's no background, just start one |   switch "$__bobthefish_current_bg" | ||||||
|     echo -n ' ' |     case '' | ||||||
|   else |       # If there's no background, just start one | ||||||
|     # If there's already a background... |       echo -n ' ' | ||||||
|     if [ "$bg" = "$__bobthefish_current_bg" ] |     case "$bg" | ||||||
|       # and it's the same color, draw a separator |       # If the background is already the same color, draw a separator | ||||||
|       echo -n "$__bobthefish_right_arrow_glyph " |       echo -n "$__bobthefish_right_arrow_glyph " | ||||||
|     else |     case '*' | ||||||
|       # otherwise, draw the end of the previous segment and the start of the next |       # otherwise, draw the end of the previous segment and the start of the next | ||||||
|       set_color $__bobthefish_current_bg |       set_color $__bobthefish_current_bg | ||||||
|       echo -n "$__bobthefish_right_black_arrow_glyph " |       echo -n "$__bobthefish_right_black_arrow_glyph " | ||||||
|       set_color $fg $argv |       set_color $fg $argv | ||||||
|     end |  | ||||||
|   end |   end | ||||||
|  | 
 | ||||||
|   set __bobthefish_current_bg $bg |   set __bobthefish_current_bg $bg | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| @ -169,13 +167,14 @@ function __bobthefish_path_segment -S -a current_dir -d 'Display a shortened for | |||||||
| end | end | ||||||
| 
 | 
 | ||||||
| function __bobthefish_finish_segments -S -d 'Close open prompt segments' | function __bobthefish_finish_segments -S -d 'Close open prompt segments' | ||||||
|   if [ -n $__bobthefish_current_bg -a $__bobthefish_current_bg != 'NONE' ] |   if [ "$__bobthefish_current_bg" != '' ] | ||||||
|     set_color -b normal |     set_color -b normal | ||||||
|     set_color $__bobthefish_current_bg |     set_color $__bobthefish_current_bg | ||||||
|     echo -n "$__bobthefish_right_black_arrow_glyph " |     echo -n "$__bobthefish_right_black_arrow_glyph " | ||||||
|     set_color normal |     set_color normal | ||||||
|   end |   end | ||||||
|   set -g __bobthefish_current_bg NONE | 
 | ||||||
|  |   set __bobthefish_current_bg | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -520,6 +519,9 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' | |||||||
| 
 | 
 | ||||||
|   set -l __bobthefish_vagrant    48B4FB |   set -l __bobthefish_vagrant    48B4FB | ||||||
| 
 | 
 | ||||||
|  |   # Start each line with a blank slate | ||||||
|  |   set -l __bobthefish_current_bg | ||||||
|  | 
 | ||||||
|   __bobthefish_prompt_status $last_status |   __bobthefish_prompt_status $last_status | ||||||
|   __bobthefish_prompt_vi |   __bobthefish_prompt_vi | ||||||
|   __bobthefish_prompt_vagrant |   __bobthefish_prompt_vagrant | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user