diff options
| author | kj-sh604 | 2025-07-16 22:10:52 -0400 |
|---|---|---|
| committer | kj-sh604 | 2025-07-16 22:10:52 -0400 |
| commit | 1e204d36c1fab9884f65618ccca019d8cd5f9386 (patch) | |
| tree | 962ebadaa02a15d2f8441b290daf330bfbd48417 /.config/shell/zsh-fast-syntax-highlighting/-fast-make-targets | |
| parent | 7c9e54b5366ada655baf8c2b61914182840d6bb6 (diff) | |
refactor: update `zsh-fast-syntax-highlighting` plugin
Diffstat (limited to '.config/shell/zsh-fast-syntax-highlighting/-fast-make-targets')
| -rw-r--r-- | .config/shell/zsh-fast-syntax-highlighting/-fast-make-targets | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/.config/shell/zsh-fast-syntax-highlighting/-fast-make-targets b/.config/shell/zsh-fast-syntax-highlighting/-fast-make-targets deleted file mode 100644 index 7f905d6..0000000 --- a/.config/shell/zsh-fast-syntax-highlighting/-fast-make-targets +++ /dev/null @@ -1,98 +0,0 @@ -# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# Almost all code borrowed from Zshell's _make function -# -# Copyright (c) 2018 Sebastian Gniazdowski - -local -a TARGETS - -_make-expandVars() { - local open close var val front='' rest=$1 - - while [[ $rest == (#b)[^$]#($)* ]]; do - front=$front${rest[1,$mbegin[1]-1]} - rest=${rest[$mbegin[1],-1]} - - case $rest[2] in - ($) # '$$'. may not appear in target and variable's value - front=$front\$\$ - rest=${rest[3,-1]} - continue - ;; - (\() # Variable of the form $(foobar) - open='(' - close=')' - ;; - ({) # ${foobar} - open='{' - close='}' - ;; - ([[:alpha:]]) # $foobar. This is exactly $(f)oobar. - open='' - close='' - var=$rest[2] - ;; - (*) # bad parameter name - print -- $front$rest - return 1 - ;; - esac - - if [[ -n $open ]]; then - if [[ $rest == \$$open(#b)([[:alnum:]_]##)(#B)$close* ]]; then - var=$match - else # unmatched () or {}, or bad parameter name - print -- $front$rest - return 1 - fi - fi - - val='' - if [[ -n ${VAR_ARGS[(i)$var]} ]]; then - val=${VAR_ARGS[$var]} - else - if [[ -n $opt_args[(I)(-e|--environment-overrides)] ]]; then - if [[ $parameters[$var] == scalar-export* ]]; then - val=${(P)var} - elif [[ -n ${VARIABLES[(i)$var]} ]]; then - val=${VARIABLES[$var]} - fi - else - if [[ -n ${VARIABLES[(i)$var]} ]]; then - val=${VARIABLES[$var]} - elif [[ $parameters[$var] == scalar-export* ]]; then - val=${(P)var} - fi - fi - fi - rest=${rest//\$$open$var$close/$val} - done - - print -- ${front}${rest} -} - - -_make-parseMakefile () { - local input var val target dep TAB=$'\t' tmp IFS= - - while read input - do - case "$input " in - # TARGET: dependencies - # TARGET1 TARGET2 TARGET3: dependencies - ([[*?[:alnum:]$][^$TAB:=%]#:[^=]*) - target=$(_make-expandVars ${input%%:*}) - TARGETS+=( ${(z)target} ) - ;; - esac - done -} - -if [[ -z "${FAST_HIGHLIGHT[chroma-make-cache]}" || $(( EPOCHSECONDS - FAST_HIGHLIGHT[chroma-make-cache-born-at] )) -gt 7 ]]; then - _make-parseMakefile - FAST_HIGHLIGHT[chroma-make-cache-born-at]="$EPOCHSECONDS" - FAST_HIGHLIGHT[chroma-make-cache]="${(j:;:)TARGETS}" -fi - -reply2=( "${(s:;:)FAST_HIGHLIGHT[chroma-make-cache]}" ) - -# vim:ft=zsh:et |
