Merge e13c86dfc2 into bc7f8ea433
				
					
				
			This commit is contained in:
		
						commit
						4d2b311b4c
					
				| 
						 | 
					@ -26,6 +26,7 @@ This highlighter defines the following styles:
 | 
				
			||||||
* `precommand` - precommand modifiers (e.g., `noglob`, `builtin`)
 | 
					* `precommand` - precommand modifiers (e.g., `noglob`, `builtin`)
 | 
				
			||||||
* `commandseparator` - command separation tokens (`;`, `&&`)
 | 
					* `commandseparator` - command separation tokens (`;`, `&&`)
 | 
				
			||||||
* `hashed-command` - hashed commands
 | 
					* `hashed-command` - hashed commands
 | 
				
			||||||
 | 
					* `command-being-typed` - prefix of a command/function/alias that isn't one itself (e.g., `sourc`, `ifconfi`)
 | 
				
			||||||
* `path` - existing filenames
 | 
					* `path` - existing filenames
 | 
				
			||||||
* `path_prefix` - prefixes of existing filenames
 | 
					* `path_prefix` - prefixes of existing filenames
 | 
				
			||||||
* `globbing` - globbing expressions (`*.txt`)
 | 
					* `globbing` - globbing expressions (`*.txt`)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,6 +40,7 @@
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[precommand]:=fg=green,underline}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[precommand]:=fg=green,underline}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[commandseparator]:=none}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[commandseparator]:=none}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[hashed-command]:=fg=green}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[hashed-command]:=fg=green}
 | 
				
			||||||
 | 
					: ${ZSH_HIGHLIGHT_STYLES[command-being-typed]:=fg=yellow,underline}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[path]:=underline}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[path]:=underline}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[path_prefix]:=underline}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[path_prefix]:=underline}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue}
 | 
				
			||||||
| 
						 | 
					@ -380,6 +381,8 @@ _zsh_highlight_main_highlighter()
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
                          if _zsh_highlight_main_highlighter_check_path; then
 | 
					                          if _zsh_highlight_main_highlighter_check_path; then
 | 
				
			||||||
                            style=$ZSH_HIGHLIGHT_STYLES[path]
 | 
					                            style=$ZSH_HIGHLIGHT_STYLES[path]
 | 
				
			||||||
 | 
					                          elif (( ${#BUFFER} == $end_pos )); then
 | 
				
			||||||
 | 
					                            style=$ZSH_HIGHLIGHT_STYLES[command-being-typed]
 | 
				
			||||||
                          else
 | 
					                          else
 | 
				
			||||||
                            style=$ZSH_HIGHLIGHT_STYLES[unknown-token]
 | 
					                            style=$ZSH_HIGHLIGHT_STYLES[unknown-token]
 | 
				
			||||||
                          fi
 | 
					                          fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,8 +27,10 @@
 | 
				
			||||||
# vim: ft=zsh sw=2 ts=2 et
 | 
					# vim: ft=zsh sw=2 ts=2 et
 | 
				
			||||||
# -------------------------------------------------------------------------------------------------
 | 
					# -------------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BUFFER='azertyuiop'
 | 
					# Do not append to the BUFFER; the second instance tests an "at end of BUFFER" feature.
 | 
				
			||||||
 | 
					BUFFER='azertyuiop; azertyuiop'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
expected_region_highlight=(
 | 
					expected_region_highlight=(
 | 
				
			||||||
  "1  10  $ZSH_HIGHLIGHT_STYLES[unknown-token]" # azertyuiop
 | 
					  "1  10  $ZSH_HIGHLIGHT_STYLES[unknown-token]" # azertyuiop
 | 
				
			||||||
 | 
					  "13 22  $ZSH_HIGHLIGHT_STYLES[command-being-typed]" # azertyuiop, at end of buffer
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue