mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
fixes after review
This commit is contained in:
parent
de46d8583a
commit
f12e1620aa
4 changed files with 85 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors
|
||||
# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
|
|
@ -45,9 +45,10 @@ _zsh_highlight_highlighter_regexp_paint(){
|
|||
done
|
||||
}
|
||||
_zsh_highlight_regexp_highlighter_loop(){
|
||||
local buf="$1" pat="$2" OFFSET="$3"
|
||||
local buf="$1" pat="$2"
|
||||
integer OFFSET=0
|
||||
local MATCH; integer MBEGIN MEND
|
||||
while true;do
|
||||
while true; do
|
||||
[[ "$buf" =~ "$pat" ]] || return;
|
||||
region_highlight+=("$((MBEGIN - 1 + OFFSET)) $((MEND + OFFSET)) $ZSH_HIGHLIGHT_REGEXP[$pat]")
|
||||
buf="$buf[$(($MEND+1)),-1]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue