Skip to content

Commit 23033df

Browse files
committed
many: Rename autoload functions to follow the standard recommendations
See: http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html#namespacing
1 parent 429ace6 commit 23033df

13 files changed

+28
-28
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

:chroma/-docker.ch

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ local -a __lines_list
6161
if (( __idx1 == 2 )); then
6262
__style=${FAST_THEME_NAME}subcommand
6363
elif (( __idx1 == 3 )); then
64-
-fast-run-command "docker images -q" chroma-docker-list ""
64+
.fast-run-command "docker images -q" chroma-docker-list ""
6565
[[ -n "${__lines_list[(r)$__wrd]}" ]] && {
6666
(( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && \
6767
reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")

:chroma/-git.ch

+9-9
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ fsh__git__chroma__def=(
630630
:chroma/-git-get-subcommands() {
631631
local __svalue
632632
integer __ivalue
633-
LANG=C -fast-run-command "git help -a" chroma-${FAST_HIGHLIGHT[chroma-current]}-subcmd-list "" $(( 15 * 60 ))
633+
LANG=C .fast-run-command "git help -a" chroma-${FAST_HIGHLIGHT[chroma-current]}-subcmd-list "" $(( 15 * 60 ))
634634
if [[ "${__lines_list[1]}" = See* ]]; then
635635
# (**)
636636
# git >= v2.20, the aliases in the `git help -a' command
@@ -646,7 +646,7 @@ fsh__git__chroma__def=(
646646
# This allows to check if the command is an alias - we want to
647647
# highlight the aliased command just like the target command of
648648
# the alias
649-
-fast-run-command "+git config --get-regexp 'alias.*'" chroma-${FAST_HIGHLIGHT[chroma-current]}-alias-list "[[:space:]]#alias." $(( 15 * 60 ))
649+
.fast-run-command "+git config --get-regexp 'alias.*'" chroma-${FAST_HIGHLIGHT[chroma-current]}-alias-list "[[:space:]]#alias." $(( 15 * 60 ))
650650
fi
651651

652652
__tmp=${#__lines_list}
@@ -660,7 +660,7 @@ fsh__git__chroma__def=(
660660
# A generic handler
661661
:chroma/-git-verify-remote() {
662662
local _wrd="$4"
663-
-fast-run-git-command "git remote" "chroma-git-remotes-$PWD" "" $(( 2 * 60 ))
663+
.fast-run-git-command "git remote" "chroma-git-remotes-$PWD" "" $(( 2 * 60 ))
664664
[[ -n ${__lines_list[(r)$_wrd]} ]] && {
665665
__style=${FAST_THEME_NAME}correct-subtle; return 0
666666
} || {
@@ -672,7 +672,7 @@ fsh__git__chroma__def=(
672672
:chroma/-git-verify-ref() {
673673
local _wrd="$4"
674674
_wrd="${_wrd%%:*}"
675-
-fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-refs-$PWD" "refs/heads" $(( 2 * 60 ))
675+
.fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-refs-$PWD" "refs/heads" $(( 2 * 60 ))
676676
[[ -n ${__lines_list[(r)$_wrd]} ]] && \
677677
{ __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
678678
{ __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
@@ -759,18 +759,18 @@ fsh__git__chroma__def=(
759759

760760
:chroma/-git-verify-branch() {
761761
local _wrd="$4"
762-
-fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches-$PWD" "refs/heads" $(( 2 * 60 ))
762+
.fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches-$PWD" "refs/heads" $(( 2 * 60 ))
763763
[[ -n ${__lines_list[(r)$_wrd]} ]] && \
764764
{ __style=${FAST_THEME_NAME}correct-subtle; return 0; } || \
765765
{ __style=${FAST_THEME_NAME}incorrect-subtle; return 1; }
766766
}
767767

768768
:chroma/-git-verify-also-unfetched-ref() {
769769
local _wrd="$4"
770-
-fast-run-git-command "git config --get checkout.defaultRemote" \
770+
.fast-run-git-command "git config --get checkout.defaultRemote" \
771771
"chroma-git-defaultRemote-$PWD" "" $(( 2 * 60 ))
772772
local remote="${__lines_list[1]:-origin}"
773-
-fast-run-git-command "git rev-list --count --no-walk
773+
.fast-run-git-command "git rev-list --count --no-walk
774774
--glob=\"refs/remotes/$remote/$_wrd\"" \
775775
"chroma-git-unfetched-ref-$PWD" "" $(( 2 * 60 ))
776776

@@ -811,7 +811,7 @@ fsh__git__chroma__def=(
811811
:chroma/-git-verify-commit() {
812812
local _wrd="$4"
813813
__lines_list=()
814-
-fast-run-git-command "git rev-parse --verify --quiet \"$_wrd\"" "chroma-git-commits-$PWD-$_wrd" "" $(( 1.5 * 60 ))
814+
.fast-run-git-command "git rev-parse --verify --quiet \"$_wrd\"" "chroma-git-commits-$PWD-$_wrd" "" $(( 1.5 * 60 ))
815815
if (( ${#__lines_list} )); then
816816
__style=${FAST_THEME_NAME}correct-subtle
817817
return 0
@@ -861,7 +861,7 @@ fsh__git__chroma__def=(
861861

862862
:chroma/-git-verify-tag-name() {
863863
local _wrd="$4"
864-
-fast-run-git-command "git tag" "chroma-git-tags-$PWD" "" $(( 2*60 ))
864+
.fast-run-git-command "git tag" "chroma-git-tags-$PWD" "" $(( 2*60 ))
865865
[[ -n ${__lines_list[(r)$_wrd]} ]] && \
866866
__style=${FAST_THEME_NAME}correct-subtle || \
867867
__style=${FAST_THEME_NAME}incorrect-subtle

:chroma/-hub.ch

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
1313
fi
1414

1515
if [[ "$__wrd" != -* ]] && (( FAST_HIGHLIGHT[chroma-git-got-subcommand] == 0 )); then
16-
-fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 5 * 60 ))
16+
.fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 5 * 60 ))
1717
# Grep for line: alias.{user-entered-subcmd}[[:space:]], and remove alias. prefix
1818
__lines_list=( ${${(M)__lines_list[@]:#alias.${__wrd}[[:space:]]##*}#alias.} )
1919

:chroma/-lab.ch

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
1717
fi
1818

1919
if [[ "$__wrd" != -* ]] && (( FAST_HIGHLIGHT[chroma-git-got-subcommand] == 0 )); then
20-
-fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 5 * 60 ))
20+
.fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 5 * 60 ))
2121
# Grep for line: alias.{user-entered-subcmd}[[:space:]], and remove alias. prefix
2222
__lines_list=( ${${(M)__lines_list[@]:#alias.${__wrd}[[:space:]]##*}#alias.} )
2323

:chroma/-make.ch

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ local -a __lines_list reply2
7373
__wrd="${(Q)__wrd}"
7474

7575
if [[ -f "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}" ]] && \
76-
-fast-make-targets < "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}"
76+
.fast-make-targets < "${FAST_HIGHLIGHT[chroma-make-custom-dir]%/}/${FAST_HIGHLIGHT[chroma-make-custom-file]}"
7777
then
7878
if [[ "${reply2[(r)$__wrd]}" ]]; then
7979
(( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")

:chroma/-ogit.ch

+11-11
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ else
7979

8080
# Check if the command is an alias - we want to highlight the
8181
# aliased command just like the target command of the alias
82-
-fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 10 * 60 ))
82+
.fast-run-command "git config --get-regexp 'alias.*'" chroma-git-alias-list "" $(( 10 * 60 ))
8383
# Grep for line: alias.{user-entered-subcmd}[[:space:]], and remove alias. prefix
8484
__lines_list=( ${${(M)__lines_list[@]:#alias.${__wrd}[[:space:]]##*}#alias.} )
8585

@@ -95,7 +95,7 @@ else
9595
fi
9696
if (( __start_pos >= 0 )); then
9797
# if subcommand exists
98-
LANG=C -fast-run-command "git help -a" chroma-git-subcmd-list "" $(( 10 * 60 ))
98+
LANG=C .fast-run-command "git help -a" chroma-git-subcmd-list "" $(( 10 * 60 ))
9999
# (s: :) will split on every space, but because the expression
100100
# isn't double-quoted, the empty elements will be eradicated
101101
# Some further knowledge-base: s-flag is special, it skips
@@ -144,10 +144,10 @@ else
144144
if [[ "$__wrd" != -* || "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" -eq 1 ]]; then
145145
(( FAST_HIGHLIGHT[chroma-git-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-git-counter] ))
146146
if (( __idx1 == 2 )); then
147-
-fast-run-git-command "git remote" "chroma-git-remotes" ""
147+
.fast-run-git-command "git remote" "chroma-git-remotes" ""
148148
else
149149
__wrd="${__wrd%%:*}"
150-
-fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
150+
.fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
151151
fi
152152
# if remote/ref exists
153153
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
@@ -173,7 +173,7 @@ else
173173
fi
174174
elif (( ${FAST_HIGHLIGHT[chroma-git-fetch-multiple]} )) \
175175
&& [[ "$__wrd" != -* || "${FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]}" -eq 1 ]]; then
176-
-fast-run-git-command "git remote" "chroma-git-remotes" ""
176+
.fast-run-git-command "git remote" "chroma-git-remotes" ""
177177
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
178178
__style=${FAST_THEME_NAME}correct-subtle
179179
fi
@@ -283,12 +283,12 @@ else
283283
__style=${FAST_THEME_NAME}incorrect-subtle
284284
fi
285285
elif [[ "$__idx1" = 3 && "$FAST_HIGHLIGHT[chroma-git-remote-subcommand]" = "add" ]]; then
286-
-fast-run-git-command "git remote" "chroma-git-remotes" ""
286+
.fast-run-git-command "git remote" "chroma-git-remotes" ""
287287
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
288288
__style=${FAST_THEME_NAME}incorrect-subtle
289289
fi
290290
elif [[ "$__idx1" = 3 && -n "$FAST_HIGHLIGHT[chroma-git-remote-subcommand]" ]]; then
291-
-fast-run-git-command "git remote" "chroma-git-remotes" ""
291+
.fast-run-git-command "git remote" "chroma-git-remotes" ""
292292
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
293293
__style=${FAST_THEME_NAME}correct-subtle
294294
else
@@ -305,7 +305,7 @@ else
305305
FAST_HIGHLIGHT[chroma-git-branch-change]=1
306306
return 1
307307
elif [[ "$__wrd" != -* ]]; then
308-
-fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
308+
.fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
309309
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
310310
__style=${FAST_THEME_NAME}correct-subtle
311311
elif (( FAST_HIGHLIGHT[chroma-git-branch-change] )); then
@@ -328,8 +328,8 @@ else
328328
if [[ "$__wrd" != -* ]]; then
329329
(( FAST_HIGHLIGHT[chroma-git-counter] += 1, __idx1 = FAST_HIGHLIGHT[chroma-git-counter] ))
330330
if [[ ${FAST_HIGHLIGHT[chroma-git-counter]} -eq 2 ]]; then
331-
-fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
332-
-fast-run-git-command "+git tag" "chroma-git-tags" ""
331+
.fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
332+
.fast-run-git-command "+git tag" "chroma-git-tags" ""
333333
[[ -n ${__lines_list[(r)$__wrd]} ]] && __style=${FAST_THEME_NAME}incorrect-subtle
334334
elif [[ ${FAST_HIGHLIGHT[chroma-git-counter]} -eq 3 ]]; then
335335
fi
@@ -346,7 +346,7 @@ else
346346
return 1;
347347
;;
348348
(3)
349-
-fast-run-git-command "git tag" "chroma-git-tags" ""
349+
.fast-run-git-command "git tag" "chroma-git-tags" ""
350350
[[ -n ${__lines_list[(r)$__wrd]} ]] && \
351351
__style=${FAST_THEME_NAME}correct-subtle || \
352352
__style=${FAST_THEME_NAME}incorrect-subtle

fast-syntax-highlighting.plugin.zsh

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ ZSH_HIGHLIGHT_MAXLENGTH=10000
319319
zmodload zsh/parameter 2>/dev/null
320320
zmodload zsh/system 2>/dev/null
321321

322-
autoload -Uz -- is-at-least fast-theme fast-read-ini-file -fast-run-git-command -fast-make-targets \
323-
-fast-run-command -fast-zts-read-all
322+
autoload -Uz -- is-at-least fast-theme .fast-read-ini-file .fast-run-git-command \
323+
.fast-make-targets .fast-run-command .fast-zts-read-all
324324
autoload -Uz -- :chroma/-git.ch :chroma/-hub.ch :chroma/-lab.ch :chroma/-example.ch \
325325
:chroma/-grep.ch :chroma/-perl.ch :chroma/-make.ch :chroma/-awk.ch \
326326
:chroma/-vim.ch :chroma/-source.ch :chroma/-sh.ch :chroma/-docker.ch \

fast-theme

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ if [[ "$1" = */* || "$1" = (XDG|LOCAL|HOME|OPT):* ]]; then
234234
[[ ! -r "$1" ]] && { print -u2 "Theme \`$1' unreadable, aborting"; return 1; }
235235
236236
THEME_NAME="${1:t:r}"
237-
fast-read-ini-file "$1" out ""
237+
.fast-read-ini-file "$1" out ""
238238
else
239239
[[ ! -f "$FAST_BASE_DIR/themes/$1.ini" ]] && { print -u2 "No such theme \`$1', aborting"; return 1; }
240240
[[ ! -r "$FAST_BASE_DIR/themes/$1.ini" ]] && { print -u2 "Theme \`$1' unreadable, aborting"; return 1; }
241241
242242
THEME_NAME="$1"
243-
fast-read-ini-file "$FAST_BASE_DIR/themes/$1.ini" out ""
243+
.fast-read-ini-file "$FAST_BASE_DIR/themes/$1.ini" out ""
244244
fi
245245
246246
[[ -z "$OPT_SECONDARY" ]] && { [[ "$THEME_NAME" = *"overlay"* ]] && local outfile="theme_overlay.zsh" || local outfile="current_theme.zsh"; } || local outfile="secondary_theme.zsh"

0 commit comments

Comments
 (0)