Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
732b7d6e65 | ||
|
|
966eb851ca |
@@ -52,18 +52,18 @@ _zsh_highlight_brackets_highlighter()
|
|||||||
|
|
||||||
# Find all brackets and remember which one is matching
|
# Find all brackets and remember which one is matching
|
||||||
for (( pos = 0; $pos < ${#BUFFER}; pos++ )) ; do
|
for (( pos = 0; $pos < ${#BUFFER}; pos++ )) ; do
|
||||||
local char=$BUFFER[pos+1]
|
local char="$BUFFER[pos+1]"
|
||||||
case $char in
|
case $char in
|
||||||
["([{"])
|
["([{"])
|
||||||
levelpos[$pos]=$((++level))
|
levelpos[$pos]=$((++level))
|
||||||
lastoflevel[$level]=$pos
|
lastoflevel[$level]=$pos
|
||||||
_zsh_highlight_brackets_highlighter_brackettype $char
|
_zsh_highlight_brackets_highlighter_brackettype "$char"
|
||||||
;;
|
;;
|
||||||
[")]}"])
|
[")]}"])
|
||||||
matching[$lastoflevel[$level]]=$pos
|
matching[$lastoflevel[$level]]=$pos
|
||||||
matching[$pos]=$lastoflevel[$level]
|
matching[$pos]=$lastoflevel[$level]
|
||||||
levelpos[$pos]=$((level--))
|
levelpos[$pos]=$((level--))
|
||||||
_zsh_highlight_brackets_highlighter_brackettype $char
|
_zsh_highlight_brackets_highlighter_brackettype "$char"
|
||||||
;;
|
;;
|
||||||
['"'\'])
|
['"'\'])
|
||||||
# Skip everything inside quotes
|
# Skip everything inside quotes
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ typeset -gA ZSH_HIGHLIGHT_STYLES
|
|||||||
# Returns 0 if the buffer has changed since _zsh_highlight was last called.
|
# Returns 0 if the buffer has changed since _zsh_highlight was last called.
|
||||||
_zsh_highlight_buffer_modified()
|
_zsh_highlight_buffer_modified()
|
||||||
{
|
{
|
||||||
[[ ${_ZSH_HIGHLIGHT_PRIOR_BUFFER:-} != $BUFFER ]]
|
[[ "${_ZSH_HIGHLIGHT_PRIOR_BUFFER:-}" != "$BUFFER" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Whether the cursor has moved or not.
|
# Whether the cursor has moved or not.
|
||||||
|
|||||||
Reference in New Issue
Block a user