Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Z
zsh-syntax-highlighting
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
浩源 何
zsh-syntax-highlighting
Commits
732b7d6e
Commit
732b7d6e
authored
12 years ago
by
Jan M. Binder
Browse files
Options
Downloads
Patches
Plain Diff
Fix bracket highlighter
parent
966eb851
No related branches found
Branches containing commit
Tags
0.1.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
highlighters/brackets/brackets-highlighter.zsh
+3
-3
3 additions, 3 deletions
highlighters/brackets/brackets-highlighter.zsh
with
3 additions
and
3 deletions
highlighters/brackets/brackets-highlighter.zsh
+
3
−
3
View file @
732b7d6e
...
...
@@ -52,18 +52,18 @@ _zsh_highlight_brackets_highlighter()
# Find all brackets and remember which one is matching
for
((
pos
=
0
;
$pos
<
${#
BUFFER
}
;
pos++
))
;
do
local
char
=
$BUFFER
[
pos+1]
local
char
=
"
$BUFFER
[pos+1]
"
case
$char
in
[
"([{"
]
)
levelpos[
$pos
]=
$((
++
level
))
lastoflevel[
$level
]=
$pos
_zsh_highlight_brackets_highlighter_brackettype
$char
_zsh_highlight_brackets_highlighter_brackettype
"
$char
"
;;
[
")]}"
]
)
matching[
$lastoflevel
[
$level
]]=
$pos
matching[
$pos
]=
$lastoflevel
[
$level
]
levelpos[
$pos
]=
$((
level--
))
_zsh_highlight_brackets_highlighter_brackettype
$char
_zsh_highlight_brackets_highlighter_brackettype
"
$char
"
;;
[
'"'
\'
]
)
# Skip everything inside quotes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment