revert: "Merge branch 'refactor/zinit-function-names' into main"

This reverts commit b979847bd4, reversing
changes made to da924a21a1.

I (@vladdoster) accidentally merged this into the wrong repository. Apologies for the lack of due diligence.
This commit is contained in:
Vladislav Doster 2022-12-17 21:09:35 -06:00
parent b979847bd4
commit 515688bc97
36 changed files with 4892 additions and 71123 deletions

View file

@ -1 +1,10 @@
.git/
.github/
.git*
doc/
scripts/
test/
tests/
*.zwc
Makefile

View file

@ -15,14 +15,14 @@ jobs:
zshelldoc:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: build docker image
run: make container-build
- name: generate documentation
run: make container-docs
- name: re-generate documentation
run: |
make doc/container
sudo chown -R "$(id -u):$(id -g)" .
- name: check for out-of-date documentation
run: |

View file

@ -34,7 +34,7 @@ ### Bug Fixes
* change ctags symbols browser key binding from `ctrl-k` to `alt-Q` ([#387](https://github.com/zdharma-continuum/zinit/issues/387)) ([7f6dc7d](https://github.com/zdharma-continuum/zinit/commit/7f6dc7da6c824b30c0e8e30ae0ecbda5be118e68)), closes [#386](https://github.com/zdharma-continuum/zinit/issues/386)
* Do not try to escape exclamation marks ([#399](https://github.com/zdharma-continuum/zinit/issues/399)) ([0e55b2e](https://github.com/zdharma-continuum/zinit/commit/0e55b2ea673915c462af752ee7d46fff55e6f436))
* docs workflow should fail if out-of-date ([#278](https://github.com/zdharma-continuum/zinit/issues/278)) ([07cde66](https://github.com/zdharma-continuum/zinit/commit/07cde660081c91382ce73b60485839710154c7c6))
* Don't error if $OPTS is not yet defined in zi::compinit call ([44765e0](https://github.com/zdharma-continuum/zinit/commit/44765e0bcb8d3f1ee3eb55286e33ad17b8c72a5e))
* Don't error if $OPTS is not yet defined in .zinit-compinit call ([44765e0](https://github.com/zdharma-continuum/zinit/commit/44765e0bcb8d3f1ee3eb55286e33ad17b8c72a5e))
* filter by runtime detected CPU before compiled CPU ([#304](https://github.com/zdharma-continuum/zinit/issues/304)) ([a4dc13f](https://github.com/zdharma-continuum/zinit/commit/a4dc13f66a65c4fa52953104c13e44a7d7c0a945)), closes [#287](https://github.com/zdharma-continuum/zinit/issues/287)
* gh-r & plugin zunit tests ([dd12fce](https://github.com/zdharma-continuum/zinit/commit/dd12fce3f49db284de7cf18a03ef891cc46bc7cc))
* gh-r filters i686 (32 bit) for x86_64 ([#226](https://github.com/zdharma-continuum/zinit/issues/226)) ([57f0d82](https://github.com/zdharma-continuum/zinit/commit/57f0d82118ed626f04d4b9b8b26de48c9d7e0956)), closes [#225](https://github.com/zdharma-continuum/zinit/issues/225)

View file

@ -1,25 +0,0 @@
# syntax=docker/dockerfile-upstream:master
ARG TARGETPLATFORM=linux/amd64
FROM --platform=$TARGETPLATFORM asciidoctor/docker-asciidoctor:latest
ENV USER root
ENV ZINIT_HOME /${USER}/zinit.git
RUN apk add \
asciidoc-doc \
make \
less \
tree \
zsh
WORKDIR /${USER}
COPY . ./zinit.git
COPY ./docker/zshrc .zshrc
RUN zsh --interactive --login -c -- '@zi::scheduler burst'
CMD ["zsh","--interactive","--login"]
# vim: set fenc=utf8 ffs=unix ft=dockerfile list noet sw=4 ts=4 tw=72:

View file

@ -1,41 +1,27 @@
.EXPORT_ALL_VARIABLES:
ZSH := $(shell command -v zsh 2> /dev/null)
SRC := share/{'git-process-output','rpm2cpio'}.zsh zinit{'','-additional','-autoload','-install','-side'}.zsh
SRC := zinit{'','-additional','-autoload','-install','-side'}.zsh
DOC_SRC := $(foreach wrd,$(SRC),../$(wrd))
HAS_TTY := $(shell [[ -z $$GITHUB_ACTIONS ]] && echo '--tty')
.PHONY: all clean container-build container-shell container-docs tags tags/emacs tags/vim test zwc
all: help
.PHONY: all clean container doc doc/container tags tags/emacs tags/vim test zwc
clean:
rm -rvf *.zwc doc/zsdoc/zinit{'','-additional','-autoload','-install','-side'}.zsh.adoc doc/zsdoc/data/
doc: clean ## Generate zinit documentation
cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\+\@\-\:\_\_a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*|\#[[:space:]][\]]*)' $(DOC_SRC); make -C ./zsdoc pdf"
container:
docker build --tag=ghcr.io/zdharma-continuum/zinit:latest --file=docker/Dockerfile .
CONTAINER_NAME := zinit
CONTAINER_CMD := docker run --interactive --mount=source=$(CONTAINER_NAME)-volume,destination=/root --platform=linux/x86_64 $(HAS_TTY)
doc: clean
cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\:\∞\.\+\@\-a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*)' $(DOC_SRC)"
container-build: ## build docker image
docker build --file=Dockerfile --platform=linux/x86_64 --tag=$(CONTAINER_NAME):latest .
doc/container: container
./scripts/docker-run.sh --docs --debug
container-docs: ## regenerate zinit docs in container
$(CONTAINER_CMD) $(CONTAINER_NAME):latest make --directory zinit.git/ doc
# Run ctags to generate Emacs and Vim's format tag file.
tags: tags/emacs tags/vim
container-shell: ## start shell in docker container
$(CONTAINER_CMD) $(CONTAINER_NAME):latest
test: ## Run zunit tests
zunit run
zwc: ## compile zsh files via zcompile
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'
tags: tags/emacs tags/vim ## run ctags to generate emacs and vim's format tag file.
tags/emacs: ## build emacs-style ctags file
tags/emacs: ## Build Emacs-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags -e -R --options=share/zsh.ctags --languages=zsh \
@ -49,7 +35,7 @@ tags/emacs: ## build emacs-style ctags file
'version) utility first.\n'; \
fi
tags/vim: ## build the vim-style ctags file
tags/vim: ## Build the Vim-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags --languages=zsh --maxdepth=1 --options=share/zsh.ctags --pattern-length-limit=250 -R; \
@ -61,8 +47,8 @@ tags/vim: ## build the vim-style ctags file
printf 'Error: Please install a ctags first.\n'; \
fi
help: ## display available make targets
@ # credit: tweekmonster github gist
@echo "$$(grep -hE '^[a-zA-Z0-9_-]+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\033[36m\1\\033[m:\2/' | column -c2 -t -s : | sort)"
test:
zunit run
# vim: set fenc=utf8 ffs=unix ft=make list noet sw=4 ts=4 tw=72:
zwc:
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'

View file

@ -115,7 +115,7 @@ # Changelog
- 06-11-2021
- 🚧 zinit has a new home: https://github.com/zdharma-continuum/zinit
- The migration from @zdharma, @Zsh-Packages and @zi::zsh is still in progress. If you are interested in helping
- The migration from @zdharma, @Zsh-Packages and @zinit-zsh is still in progress. If you are interested in helping
or want to let us know that a particular project is missing, please head to
[I_WANT_TO_HELP](https://github.com/zdharma-continuum/I_WANT_TO_HELP/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
- 📚 zinit now ensures that the man dirs under `$ZPFX/man` are created on startup. Please note that these directories

View file

@ -1,59 +1,57 @@
# This Makefile is to convert supplied Asciidoc files into
# other formats like pdf and man. The files contain Zplugin's
# code documentation.
# *.adoc files are generated by Makefile from upper (i.e. top) directory.
#
# *.adoc files are generated by Makefile from upper (i.e. top)
# directory.
SRC := $(shell zsh -c "echo {'git-process-output','rpm2cpio'}.zsh zinit{'','-additional','-autoload','-install','-side'}.zsh")
all: man pdf
PDF_SRC := $(foreach wrd,$(SRC),$(wrd).pdf)
PDF_CMD := asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf
# MANUALS
# Converted with a2x from asciidoc package
MAN_SRC := $(foreach wrd,$(SRC),man/$(wrd))
MAN_CMD := a2x --verbose -L --doctype manpage --format manpage -D man
man: man/zinit.zsh.1 man/zinit-side.zsh.1 man/zinit-install.zsh.1 man/zinit-autoload.zsh.1
.PHONY: all clean test man pdf
man/zinit.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit.zsh.adoc
all: clean man pdf
dirs:
mkdir -p man pdf
man/zinit-side.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-side.zsh.adoc
# Manual pages
# uses a2x from asciidoc package
man: dirs $(MAN_SRC)
man/git-process-output.zsh:
$(MAN_CMD) git-process-output.zsh.adoc
man/rpm2cpio.zsh:
$(MAN_CMD) rpm2cpio.zsh.adoc
man/zinit-additional.zsh:
$(MAN_CMD) zinit-additional.zsh.adoc
man/zinit-autoload.zsh:
$(MAN_CMD) zinit-autoload.zsh.adoc
man/zinit-install.zsh:
$(MAN_CMD) zinit-install.zsh.adoc
man/zinit-side.zsh:
$(MAN_CMD) zinit-side.zsh.adoc
man/zinit.zsh:
$(MAN_CMD) zinit.zsh.adoc
man/zinit-install.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-install.zsh.adoc
man/zinit-autoload.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-autoload.zsh.adoc
# PDFS
# uses asciidoctor not a2x (i.e. not asciidoc)
pdf: dirs $(PDF_SRC)
git-process-output.zsh.pdf:
$(PDF_CMD) git-process-output.zsh.adoc
rpm2cpio.zsh.pdf:
$(PDF_CMD) rpm2cpio.zsh.adoc
zinit-additional.zsh.pdf:
$(PDF_CMD) zinit-additional.zsh.adoc
zinit-autoload.zsh.pdf:
$(PDF_CMD) zinit-autoload.zsh.adoc
zinit-install.zsh.pdf:
$(PDF_CMD) zinit-install.zsh.adoc
zinit-side.zsh.pdf:
$(PDF_CMD) zinit-side.zsh.adoc
zinit.zsh.pdf:
$(PDF_CMD) zinit.zsh.adoc
# Uses asciidoctor not a2x (i.e. not asciidoc)
pdf: pdf/zinit.zsh.pdf pdf/zinit-side.zsh.pdf pdf/zinit-install.zsh.pdf pdf/zinit-autoload.zsh.pdf
pdf/zinit.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit.zsh.adoc
pdf/zinit-side.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-side.zsh.adoc
pdf/zinit-install.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-install.zsh.adoc
pdf/zinit-autoload.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-autoload.zsh.adoc
clean:
rm -rf man pdf data
# vim:ft=make:noet:sts=4:ts=4
.PHONY: man pdf clean
# vim:noet:sts=8:ts=8

View file

@ -1,75 +0,0 @@
git-process-output.zsh(1)
=========================
:compat-mode!:
NAME
----
git-process-output.zsh - a shell script
SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
print_my_line
print_my_line_compress
timeline
DETAILS
-------
Script Body
~~~~~~~~~~~
Has 113 line(s). Calls functions:
Script-Body
|-- print_my_line
|-- print_my_line_compress
`-- timeline
Uses feature(s): _eval_, _read_, _setopt_, _trap_
print_my_line
~~~~~~~~~~~~~
____
$1 - n. of objects
$2 - packed objects
$3 - total objects
$4 - receiving percentage
$5 - resolving percentage
____
Has 13 line(s). Doesn't call other functions.
Called by:
Script-Body
print_my_line_compress
~~~~~~~~~~~~~~~~~~~~~~
Has 12 line(s). Doesn't call other functions.
Called by:
Script-Body
timeline
~~~~~~~~
____
Code by leoj3n
____
Has 15 line(s). Doesn't call other functions.
Called by:
Script-Body

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,24 +0,0 @@
rpm2cpio.zsh(1)
===============
:compat-mode!:
NAME
----
rpm2cpio.zsh - a shell script
SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
DETAILS
-------
Script Body
~~~~~~~~~~~
Has 51 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).

View file

@ -13,13 +13,13 @@ Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
:zi::tmp-subst-source
zi::clear-debug-report
zi::debug-start
zi::debug-stop
zi::debug-unload
zi::service
zi::wrap-track-functions
.zinit-clear-debug-report
.zinit-debug-start
.zinit-debug-stop
.zinit-debug-unload
.zinit-service
.zinit-wrap-track-functions
:zinit-tmp-subst-source
DETAILS
-------
@ -29,20 +29,8 @@ Script Body
Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
:zi::tmp-subst-source
~~~~~~~~~~~~~~~~~~~~~
Has 25 line(s). Calls functions:
:zi::tmp-subst-source
`-- zinit.zsh/+zi::message
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
zi::clear-debug-report
~~~~~~~~~~~~~~~~~~~~~~
.zinit-clear-debug-report
~~~~~~~~~~~~~~~~~~~~~~~~~
____
@ -51,16 +39,16 @@ ____
Has 1 line(s). Calls functions:
zi::clear-debug-report
`-- zinit-autoload.zsh/zi::clear-report-for
.zinit-clear-debug-report
`-- zinit-autoload.zsh/.zinit-clear-report-for
Called by:
zinit-autoload.zsh/zi::unload
zinit-autoload.zsh/.zinit-unload
zinit.zsh/zinit
zi::debug-start
~~~~~~~~~~~~~~~
.zinit-debug-start
~~~~~~~~~~~~~~~~~~
____
@ -69,17 +57,17 @@ ____
Has 9 line(s). Calls functions:
zi::debug-start
|-- zinit.zsh/+zi::message
|-- zinit.zsh/zi::diff
`-- zinit.zsh/zi::tmp-subst-on
.zinit-debug-start
|-- zinit.zsh/+zinit-message
|-- zinit.zsh/.zinit-diff
`-- zinit.zsh/.zinit-tmp-subst-on
Called by:
zinit.zsh/zinit
zi::debug-stop
~~~~~~~~~~~~~~
.zinit-debug-stop
~~~~~~~~~~~~~~~~~
____
@ -88,16 +76,16 @@ ____
Has 3 line(s). Calls functions:
zi::debug-stop
|-- zinit.zsh/zi::diff
`-- zinit.zsh/zi::tmp-subst-off
.zinit-debug-stop
|-- zinit.zsh/.zinit-diff
`-- zinit.zsh/.zinit-tmp-subst-off
Called by:
zinit.zsh/zinit
zi::debug-unload
~~~~~~~~~~~~~~~~
.zinit-debug-unload
~~~~~~~~~~~~~~~~~~~
____
@ -106,9 +94,9 @@ ____
Has 6 line(s). Calls functions:
zi::debug-unload
|-- zinit-autoload.zsh/zi::unload
`-- zinit.zsh/+zi::message
.zinit-debug-unload
|-- zinit-autoload.zsh/.zinit-unload
`-- zinit.zsh/+zinit-message
Uses feature(s): _source_
@ -116,8 +104,8 @@ Called by:
zinit.zsh/zinit
zi::service
~~~~~~~~~~~
.zinit-service
~~~~~~~~~~~~~~
____
@ -130,16 +118,16 @@ ____
Has 37 line(s). Calls functions:
zi::service
|-- zinit.zsh/zi::load
`-- zinit.zsh/zi::load-snippet
.zinit-service
|-- zinit.zsh/.zinit-load
`-- zinit.zsh/.zinit-load-snippet
Uses feature(s): _kill_, _read_, _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
zi::wrap-track-functions
~~~~~~~~~~~~~~~~~~~~~~~~
.zinit-wrap-track-functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Has 19 line(s). Doesn't call other functions.
@ -147,3 +135,15 @@ Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
:zinit-tmp-subst-source
~~~~~~~~~~~~~~~~~~~~~~~
Has 25 line(s). Calls functions:
:zinit-tmp-subst-source
`-- zinit.zsh/+zinit-message
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -13,14 +13,14 @@ Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
zi::any-colorify-as-uspl2
zi::compute-ice
zi::countdown
zi::exists-physically
zi::exists-physically-message
zi::first
zi::store-ices
zi::two-paths
.zinit-any-colorify-as-uspl2
.zinit-compute-ice
.zinit-countdown
.zinit-exists-physically
.zinit-exists-physically-message
.zinit-first
.zinit-store-ices
.zinit-two-paths
DETAILS
-------
@ -30,8 +30,8 @@ Script Body
Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
zi::any-colorify-as-uspl2
~~~~~~~~~~~~~~~~~~~~~~~~~
.zinit-any-colorify-as-uspl2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
____
@ -46,36 +46,36 @@ ____
Has 22 line(s). Calls functions:
zi::any-colorify-as-uspl2
|-- zinit.zsh/zi::any-to-pid
`-- zinit.zsh/zi::any-to-user-plugin
.zinit-any-colorify-as-uspl2
|-- zinit.zsh/.zinit-any-to-pid
`-- zinit.zsh/.zinit-any-to-user-plugin
Called by:
zi::exists-physically-message
zinit-autoload.zsh/zi::clear-completions
zinit-autoload.zsh/zi::compile-uncompile-all
zinit-autoload.zsh/zi::compiled
zinit-autoload.zsh/zi::create
zinit-autoload.zsh/zi::exists-message
zinit-autoload.zsh/zi::get-completion-owner-uspl2col
zinit-autoload.zsh/zi::list-bindkeys
zinit-autoload.zsh/zi::recently
zinit-autoload.zsh/zi::search-completions
zinit-autoload.zsh/zi::show-completions
zinit-autoload.zsh/zi::show-registered-plugins
zinit-autoload.zsh/zi::show-times
zinit-autoload.zsh/zi::uncompile-plugin
zinit-autoload.zsh/zi::unload
zinit-autoload.zsh/zi::update-all-parallel
zinit-autoload.zsh/zi::update-or-status-all
zinit-autoload.zsh/zi::update-or-status
zinit-install.zsh/zi::install-completions
zinit-install.zsh/zi::setup-plugin-dir
zinit.zsh/zi::formatter-pid
.zinit-exists-physically-message
zinit-autoload.zsh/.zinit-clear-completions
zinit-autoload.zsh/.zinit-compile-uncompile-all
zinit-autoload.zsh/.zinit-compiled
zinit-autoload.zsh/.zinit-create
zinit-autoload.zsh/.zinit-exists-message
zinit-autoload.zsh/.zinit-get-completion-owner-uspl2col
zinit-autoload.zsh/.zinit-list-bindkeys
zinit-autoload.zsh/.zinit-recently
zinit-autoload.zsh/.zinit-search-completions
zinit-autoload.zsh/.zinit-show-completions
zinit-autoload.zsh/.zinit-show-registered-plugins
zinit-autoload.zsh/.zinit-show-times
zinit-autoload.zsh/.zinit-uncompile-plugin
zinit-autoload.zsh/.zinit-unload
zinit-autoload.zsh/.zinit-update-all-parallel
zinit-autoload.zsh/.zinit-update-or-status-all
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-install-completions
zinit-install.zsh/.zinit-setup-plugin-dir
zinit.zsh/.zinit-formatter-pid
zi::compute-ice
~~~~~~~~~~~~~~~
.zinit-compute-ice
~~~~~~~~~~~~~~~~~~
____
@ -102,39 +102,23 @@ ____
Has 110 line(s). Calls functions:
zi::compute-ice
|-- zi::exists-physically-message
|   |-- zi::any-colorify-as-uspl2
|   |   |-- zinit.zsh/zi::any-to-pid
|   |   `-- zinit.zsh/zi::any-to-user-plugin
|   |-- zi::exists-physically
|   |   `-- zinit.zsh/zi::any-to-user-plugin
|   |-- zinit.zsh/+zi::message
|   |-- zinit.zsh/zi::any-to-pid
|   `-- zinit.zsh/zi::any-to-user-plugin
|-- zi::two-paths
|   |-- zi::first
|   |   |-- zinit.zsh/zi::any-to-pid
|   |   |-- zinit.zsh/zi::any-to-user-plugin
|   |   |-- zinit.zsh/zi::find-other-matches
|   |   `-- zinit.zsh/zi::get-object-path
|   `-- zinit.zsh/zi::get-object-path
|-- zinit.zsh/zi::any-to-user-plugin
`-- zinit.zsh/zi::pack-ice
.zinit-compute-ice
|-- zinit.zsh/.zinit-any-to-user-plugin
`-- zinit.zsh/.zinit-pack-ice
Uses feature(s): _setopt_
Called by:
zinit-autoload.zsh/zi::delete
zinit-autoload.zsh/zi::edit
zinit-autoload.zsh/zi::recall
zinit-autoload.zsh/zi::update-or-status-snippet
zinit-autoload.zsh/zi::update-or-status
zinit-install.zsh/zi::compile-plugin
zinit-autoload.zsh/.zinit-delete
zinit-autoload.zsh/.zinit-edit
zinit-autoload.zsh/.zinit-recall
zinit-autoload.zsh/.zinit-update-or-status-snippet
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-compile-plugin
zi::countdown
~~~~~~~~~~~~~
.zinit-countdown
~~~~~~~~~~~~~~~~
____
@ -145,23 +129,23 @@ ____
Has 20 line(s). Calls functions:
zi::countdown
`-- zinit.zsh/+zi::message
.zinit-countdown
`-- zinit.zsh/+zinit-message
Uses feature(s): _trap_
Called by:
zinit-autoload.zsh/zi::run-delete-hooks
zinit-install.zsh/__zi::atclone-hook
zinit-install.zsh/__zi::atpull-e-hook
zinit-install.zsh/__zi::atpull-hook
zinit-install.zsh/__zi::configure-base-hook
zinit-install.zsh/__zi::make-base-hook
zinit-install.zsh/zi::configure-run-autoconf
zinit-autoload.zsh/.zinit-run-delete-hooks
zinit-install.zsh/.zinit-configure-run-autoconf
zinit-install.zsh/∞zinit-atclone-hook
zinit-install.zsh/∞zinit-atpull-e-hook
zinit-install.zsh/∞zinit-atpull-hook
zinit-install.zsh/∞zinit-configure-base-hook
zinit-install.zsh/∞zinit-make-base-hook
zi::exists-physically
~~~~~~~~~~~~~~~~~~~~~
.zinit-exists-physically
~~~~~~~~~~~~~~~~~~~~~~~~
____
@ -173,17 +157,17 @@ ____
Has 8 line(s). Calls functions:
zi::exists-physically
`-- zinit.zsh/zi::any-to-user-plugin
.zinit-exists-physically
`-- zinit.zsh/.zinit-any-to-user-plugin
Called by:
zi::exists-physically-message
zinit-autoload.zsh/zi::create
zinit-autoload.zsh/zi::update-or-status
.zinit-exists-physically-message
zinit-autoload.zsh/.zinit-create
zinit-autoload.zsh/.zinit-update-or-status
zi::exists-physically-message
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.zinit-exists-physically-message
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
____
@ -196,37 +180,32 @@ ____
Has 25 line(s). Calls functions:
zi::exists-physically-message
|-- zi::any-colorify-as-uspl2
|   |-- zinit.zsh/zi::any-to-pid
|   `-- zinit.zsh/zi::any-to-user-plugin
|-- zi::exists-physically
|   `-- zinit.zsh/zi::any-to-user-plugin
|-- zinit.zsh/+zi::message
|-- zinit.zsh/zi::any-to-pid
`-- zinit.zsh/zi::any-to-user-plugin
.zinit-exists-physically-message
|-- zinit.zsh/+zinit-message
|-- zinit.zsh/.zinit-any-to-pid
`-- zinit.zsh/.zinit-any-to-user-plugin
Uses feature(s): _setopt_
Called by:
zi::compute-ice
zinit-autoload.zsh/zi::changes
zinit-autoload.zsh/zi::glance
zinit-autoload.zsh/zi::stress
zinit-autoload.zsh/zi::update-or-status
zinit-install.zsh/zi::install-completions
.zinit-compute-ice
zinit-autoload.zsh/.zinit-changes
zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/.zinit-stress
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-install-completions
zi::first
~~~~~~~~~
.zinit-first
~~~~~~~~~~~~
____
Finds the main file of plugin. There are multiple file name formats, they are
ordered in order starting from more correct ones, and matched.
zi::load-plugin() has similar code parts and doesn't call zi::first()
for performance. Obscure matching is done in zi::find-other-matches, here
and in zi::load(). Obscure = non-standard main-file naming convention.
.zinit-load-plugin() has similar code parts and doesn't call .zinit-first()
for performance. Obscure matching is done in .zinit-find-other-matches, here
and in .zinit-load(). Obscure = non-standard main-file naming convention.
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given)
@ -234,21 +213,21 @@ ____
Has 20 line(s). Calls functions:
zi::first
|-- zinit.zsh/zi::any-to-pid
|-- zinit.zsh/zi::any-to-user-plugin
|-- zinit.zsh/zi::find-other-matches
`-- zinit.zsh/zi::get-object-path
.zinit-first
|-- zinit.zsh/.zinit-any-to-pid
|-- zinit.zsh/.zinit-any-to-user-plugin
|-- zinit.zsh/.zinit-find-other-matches
`-- zinit.zsh/.zinit-get-object-path
Called by:
zi::two-paths
zinit-autoload.zsh/zi::glance
zinit-autoload.zsh/zi::stress
zinit-install.zsh/zi::compile-plugin
.zinit-two-paths
zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/.zinit-stress
zinit-install.zsh/.zinit-compile-plugin
zi::store-ices
~~~~~~~~~~~~~~
.zinit-store-ices
~~~~~~~~~~~~~~~~~
____
@ -266,12 +245,12 @@ Has 30 line(s). Doesn't call other functions.
Called by:
zinit-autoload.zsh/zi::update-or-status
zinit-install.zsh/zi::download-snippet
zinit-install.zsh/zi::setup-plugin-dir
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-download-snippet
zinit-install.zsh/.zinit-setup-plugin-dir
zi::two-paths
~~~~~~~~~~~~~
.zinit-two-paths
~~~~~~~~~~~~~~~~
____
@ -284,18 +263,13 @@ ____
Has 24 line(s). Calls functions:
zi::two-paths
|-- zi::first
|   |-- zinit.zsh/zi::any-to-pid
|   |-- zinit.zsh/zi::any-to-user-plugin
|   |-- zinit.zsh/zi::find-other-matches
|   `-- zinit.zsh/zi::get-object-path
`-- zinit.zsh/zi::get-object-path
.zinit-two-paths
`-- zinit.zsh/.zinit-get-object-path
Uses feature(s): _setopt_
Called by:
zi::compute-ice
zinit-autoload.zsh/zi::update-or-status
.zinit-compute-ice
zinit-autoload.zsh/.zinit-update-or-status

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,6 @@ USER ${PUSERNAME}
# Fetch keys config and store it outside of ZINIT[HOME_DIR] since it might get
# overridden at runtime (the /data volume)
RUN ZINIT_HOME_DIR=/data-static ZSH_NO_INIT=1 \
zsh -ils -c -- '@zi::scheduler burst'
zsh -ils -c -- '@zinit-scheduler burst'
CMD ["/bin/zsh"]

View file

@ -1,26 +1,41 @@
#!/usr/bin/env zsh
# Initialization. Trigger stuff that only needs to be run once, at startup.
if [[ "$$" == 1 ]] && [[ -z "$ZSH_NO_INIT" ]]
then
source /src/docker/init.zsh
fi
typeset -Ag ZINIT
ZINIT[HOME_DIR]=${ZINIT_DATA:-$HOME/zinit}
ZINIT[BIN_DIR]=${ZINIT_SRC:-$HOME/zinit.git}
source ${ZINIT[BIN_DIR]}/zinit.zsh
# load zinit
source /src/zinit.zsh
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
#=== OH-MY-ZSH & PREZTO PLUGINS =======================
zi is-snippet light-mode nocompletions for {PZTM::{environment,history},OMZL::{compfix,completion,git,key-bindings}.zsh}
#=== COMPLETIONS ======================================
zi make"PREFIX=/usr/local install" load for @zdharma-continuum/zshelldoc
#=== PROMPT ===========================================
eval "MODE_CURSOR_"{'SEARCH="#ff00ff blinking underline"','VICMD="green block"','VIINS="#ffff00 bar"'}";"
zi for as'null' compile'(pure|async).zsh' multisrc'(pure|async).zsh' light-mode atinit"
PURE_GIT_DOWN_ARROW='↓'; PURE_GIT_UP_ARROW='↑'
PURE_PROMPT_SYMBOL=''; PURE_PROMPT_VICMD_SYMBOL=''
zstyle ':prompt:pure:git:action' color 'yellow'
zstyle ':prompt:pure:git:branch' color 'blue'
zstyle ':prompt:pure:git:dirty' color 'red'
zstyle ':prompt:pure:path' color 'cyan'
zstyle ':prompt:pure:prompt:success' color 'green'" \
@sindresorhus/pure
# load zinit setup utility functions
source /src/docker/utils.zsh
# Add ZPFX/bin and GOPATH/bin to PATH
typeset -U path
path=("${ZPFX:-${HOME}/.local/share/zinit/polaris}/bin" "${HOME}/go/bin" $path)
# Install custom zsh version
if [[ -n "$ZINIT_ZSH_VERSION" ]]
then
zinit::pack-zsh "$ZINIT_ZSH_VERSION"
fi
source /src/docker/zshrc-fancy
# Source init file
INIT_FILE="/init.zsh"
if [[ -r "$INIT_FILE" ]]
then
source "$INIT_FILE"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

81
scripts/docker-build.sh Executable file
View file

@ -0,0 +1,81 @@
#!/usr/bin/env bash
build() {
cd "$(
cd "$(dirname "$0")" > /dev/null 2>&1
pwd -P
)" || exit 9
local image_name="${1:-zinit}"
local tag="${2:-latest}"
local zsh_version="${3}"
shift 3
local dockerfile="../docker/Dockerfile"
if [[ -n $zsh_version ]]; then
tag="zsh${zsh_version}-${tag}"
fi
echo -e "\e[34mBuilding image: ${image_name}\e[0m" >&2
local -a args
[[ -n $NO_CACHE ]] && args+=(--no-cache "$@")
if docker build \
--build-arg "PUSERNAME=$(id -u -n)" \
--build-arg "PUID=$(id -u)" \
--build-arg "PGID=$(id -g)" \
--build-arg "TERM=${TERM:-xterm-256color}" \
--build-arg "ZINIT_ZSH_VERSION=${zsh_version}" \
--file "$dockerfile" \
--tag "${image_name}:${tag}" \
"${args[@]}" \
"$(realpath ..)"; then
{
echo -e "\e[34mTo use this image for zunit tests run: \e[0m"
echo -e "\e[34mexport CONTAINER_IMAGE=\"${image_name}\" CONTAINER_TAG=\"${tag}\"\e[0m"
echo -e "\e[34mzunit run --verbose\e[0m"
} >&2
else
echo -e "\e[31m❌ Container failed to build.\e[0m" >&2
return 1
fi
}
if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then
BUILD_ZSH_VERSION="${BUILD_ZSH_VERSION:-}"
CONTAINER_IMAGE="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}"
CONTAINER_TAG="${CONTAINER_TAG:-latest}"
NO_CACHE="${NO_CACHE:-}"
while [[ -n $* ]]; do
case "$1" in
--image | -i)
CONTAINER_IMAGE="$2"
shift 2
;;
--no-cache | -N)
NO_CACHE=1
shift
;;
--zsh-version | -zv | --zv)
BUILD_ZSH_VERSION="${2}"
shift 2
;;
*)
break
;;
esac
done
build "${CONTAINER_IMAGE}" "${CONTAINER_TAG}" "${BUILD_ZSH_VERSION}" "$@"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=bash sw=2 ts=2 et

260
scripts/docker-run.sh Executable file
View file

@ -0,0 +1,260 @@
#!/usr/bin/env bash
parent_process() {
local ppid pcmd
ppid="$(ps -o ppid= -p "$$" | awk '{ print $1 }')"
if [[ -z $ppid ]]; then
echo "Failed to determine parent process" >&2
return 1
fi
if pcmd="$(ps -o cmd= -p "$ppid")"; then
echo "$pcmd"
return
fi
return 1
}
running_interactively() {
if [[ -n $CI ]]; then
return 1
fi
if ! [[ -t 1 ]]; then
# return false if running non-interactively, unless run with zunit
parent_process | grep -q zunit
fi
}
create_init_config_file() {
local tempfile
if [[ -z $* ]]; then
return 1
fi
tempfile="$(mktemp)"
echo "$*" > "$tempfile"
# DIRTYFIX perms...
chmod 666 "$tempfile"
echo "$tempfile"
}
run() {
local image="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}"
local tag="${CONTAINER_TAG:-latest}"
local init_config="$1"
shift
local -a args=(--rm)
local cruntime=docker
local sudo_cmd
if [[ -z $CI ]] && command -v podman > /dev/null 2>&1; then
cruntime=podman
# rootless containers are a PITA
# https://www.tutorialworks.com/podman-rootless-volumes/
sudo_cmd=sudo
fi
if running_interactively; then
args+=(--tty=true --interactive=true)
fi
if [[ -n $init_config ]]; then
if [[ -r $init_config ]]; then
args+=(--volume "${init_config}:/init.zsh")
else
echo "❌ Init config file is not readable" >&2
return 1
fi
fi
if [[ -n $CONTAINER_WORKDIR ]]; then
args+=(--workdir "$CONTAINER_WORKDIR")
fi
# Inherit TERM
if [[ -n $TERM ]]; then
args+=(--env "TERM=${TERM}")
fi
if [[ -n ${CONTAINER_ENV[*]} ]]; then
local e
for e in "${CONTAINER_ENV[@]}"; do
args+=(--env "${e}")
done
fi
if [[ -n ${CONTAINER_VOLUMES[*]} ]]; then
local vol
for vol in "${CONTAINER_VOLUMES[@]}"; do
# shellcheck disable=2076
if [[ ! " ${args[*]} " =~ " --volume ${vol} " ]]; then
args+=(--volume "${vol}")
fi
done
fi
local -a cmd=("$@")
if [[ -n $WRAP_CMD ]]; then
local zsh_opts="ilsc"
[[ -n $ZSH_DEBUG ]] && zsh_opts="x${zsh_opts}"
cmd=(zsh "-${zsh_opts}" "${cmd[*]}")
fi
if [[ -n $DEBUG ]]; then
{
# The @Q below is necessary to keep the quotes intact
# https://stackoverflow.com/a/12985353/1872036
echo -e "🚀 \e[35mRunning command"
echo -e "\$ ${cruntime} run ${args[*]} ${image}:${tag} ${cmd[*]@Q}\e[0m"
} >&2
fi
${sudo_cmd} "${cruntime}" run "${args[@]}" "${image}:${tag}" "${cmd[@]}"
}
if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then
CONTAINER_ENV=()
CONTAINER_IMAGE="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}"
CONTAINER_TAG="${CONTAINER_TAG:-latest}"
CONTAINER_VOLUMES=()
CONTAINER_WORKDIR="${CONTAINER_WORKDIR:-}"
DEBUG="${DEBUG:-}"
INIT_CONFIG_VAL="${INIT_CONFIG_VAL:-}"
PRESET="${PRESET:-}"
WRAP_CMD="${WRAP_CMD:-}"
ZSH_DEBUG="${ZSH_DEBUG:-}"
while [[ -n $* ]]; do
case "$1" in
# Fetch init config from clipboard (Linux only)
--xsel | -b)
INIT_CONFIG_VAL="$(xsel -b)"
shift
;;
-c | --config | --init-config | --init)
INIT_CONFIG_VAL="$2"
shift 2
;;
-f | --config-file | --init-config-file | --file)
if ! [[ -r $2 ]]; then
echo "Unable to read from file: $2" >&2
exit 2
fi
INIT_CONFIG_VAL="$(cat "$2")"
shift 2
;;
-d | --debug)
DEBUG=1
shift
;;
-D | --dev | --devel)
DEVEL=1
shift
;;
--docs)
PRESET=docs
shift
;;
-i | --image)
CONTAINER_IMAGE="$2"
shift 2
;;
-t | --tag)
CONTAINER_TAG="$2"
shift 2
;;
# Additional container env vars
-e | --env | --environment)
CONTAINER_ENV+=("$2")
shift 2
;;
# Additional container volumes
-v | --volume)
CONTAINER_VOLUMES+=("$2")
shift 2
;;
# Whether to wrap the command in zsh -silc
-w | --wrap)
WRAP_CMD=1
shift
;;
--tests | --zunit | -z)
PRESET=zunit
shift
;;
# Whether to enable debug tracing of zinit (zsh -x)
# Only applies to wrapped commands (--w|--wrap)
--zsh-debug | -x | -Z)
ZSH_DEBUG=1
shift
;;
*)
break
;;
esac
done
GIT_ROOT_DIR="$(git rev-parse --show-toplevel)"
CMD=("$@")
case "$PRESET" in
zunit)
# Mount root of the repo to /src
# Mount /tmp/zunit-zinit to /data
CONTAINER_VOLUMES+=(
"${GIT_ROOT_DIR}:/src"
"${TMPDIR:-/tmp}/zunit-zinit:/data"
)
CONTAINER_ENV+=(
"QUIET=1"
"NOTHING_FANCY=1"
)
;;
docs)
# Mount root of the repo to /src
CONTAINER_VOLUMES+=(
"${GIT_ROOT_DIR}:/src"
)
CONTAINER_ENV+=(
"QUIET=1"
"NOTHING_FANCY=1"
"LC_ALL=en_US.UTF-8"
)
CONTAINER_WORKDIR=/src
# shellcheck disable=2016
INIT_CONFIG_VAL='zinit nocompile make'\''PREFIX=$ZPFX install'\'' for zdharma-continuum/zshelldoc'
# shellcheck disable=2016
CMD=(zsh -ilsc
'sudo chown -R "$(id -u):$(id -g)" /src &&
@zinit-scheduler burst &&
sudo apk add tree &&
make -C /src doc')
;;
esac
if INIT_CONFIG="$(create_init_config_file "$INIT_CONFIG_VAL")"; then
trap 'rm -vf $INIT_CONFIG' EXIT INT
fi
if [[ -n $DEVEL ]]; then
# Mount root of the repo to /src
CONTAINER_VOLUMES+=(
"${GIT_ROOT_DIR}:/src"
)
fi
run "$INIT_CONFIG" "${CMD[@]}"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=bash sw=2 ts=2 et

View file

@ -261,7 +261,7 @@ EOF
if [ "$reply" = y ] || [ "$reply" = Y ]; then
command cat "$zshrc_annex_file" >> "$ZSHRC"
echo_info "Installing annexes"
zsh -ic "@zi::scheduler burst"
zsh -ic "@zinit-scheduler burst"
echo_success 'Done!'
else
echo_warning "Skipped the annexes."

View file

@ -177,4 +177,10 @@ print
unset ZINIT_CNORM ZINIT_CIVIS
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 :
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -55,4 +55,10 @@ fi
command "$UNPACKCMD[@]" 2>/dev/null | command "$DECOMPRESSCMD[@]"
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 :
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,10 +1,9 @@
#!/usr/bin/env zsh
_annex_test_function() {
# run zinit load zdharma-continuum/${1}
run zinit id-as ver'refactor/zinit-function-names' for load vladdoster/${1}
run zinit load zdharma-continuum/${1}
assert ${state} equals 0
zinit cd ${1}
zinit cd zdharma-continuum/${1}
assert ${PWD}/${${1}//zinit-annex/z-a}.plugin.zsh is_file
assert ${PWD}/${${1}//zinit-annex/z-a}.plugin.zsh is_readable
}

View file

@ -40,8 +40,10 @@ source $ZINIT[BIN_DIR]/zinit.zsh \
# ]]]
# Install Annexes [[[
info 'installing test dependencies'
zi id-as ver'refactor/zinit-function-names' light-mode for \
@vladdoster/zinit-annex-{bin-gem-node,binary-symlink,default-ice,patch-dl,submods}
# ver'fix/improve-lbin-logic' \
zinit depth'1' light-mode for \
zdharma-continuum/zinit-annex-binary-symlink \
zdharma-continuum/zinit-annex-{'bin-gem-node','default-ice'}
# ]]]
# vim:ft=zsh:sw=2:sts=2:et:foldmarker=[[[,]]]:foldmethod=marker

View file

@ -484,4 +484,10 @@ elif (( __tfind_spe_call_count > 0 )); then
(( __tfind_spe_call_count -- ))
fi
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 :
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,8 +1,8 @@
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors.
# FUNCTION: :zi::tmp-subst-source [[[
:zi::tmp-subst-source() {
# FUNCTION: :zinit-tmp-subst-source [[[
:zinit-tmp-subst-source() {
local -a ___substs ___ab
___substs=( "${(@s.;.)ICE[subst]}" )
if [[ -n ${(M)___substs:#*\\(#e)} ]] {
@ -12,7 +12,7 @@
# Load the plugin
if [[ ! -r $1 ]] {
+zi::message "{error}source: Couldn't read the script {obj}${1}{error}" \
+zinit-message "{error}source: Couldn't read the script {obj}${1}{error}" \
", cannot substitute {data}${ICE[subst]}{error}.{rst}"
}
@ -31,13 +31,13 @@
builtin eval "$___data"
} # ]]]
# FUNCTION: zi::service [[[
# FUNCTION: .zinit-service [[[
# Handles given service, i.e. obtains lock, runs it, or waits if no lock
#
# $1 - type "p" or "s" (plugin or snippet)
# $2 - mode - for plugin (light or load)
# $3 - id - URL or plugin ID or alias name (from id-as'')
zi::service() {
.zinit-service() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob warncreateglobal typesetsilent noshortloops
@ -55,10 +55,10 @@ zi::service() {
___lckd=1
if (( ! ___strd )) || [[ $___cmd = RESTART ]]; then
[[ $___tpe = p ]] && { ___strd=1
zi::load "$___id" "" "$___mode" 0;
.zinit-load "$___id" "" "$___mode" 0;
}
[[ $___tpe = s ]] && { ___strd=1
zi::load-snippet "$___id" "" 0;
.zinit-load-snippet "$___id" "" 0;
}
fi
___cmd=
@ -76,8 +76,9 @@ zi::service() {
builtin read -t 1 ___tmp <>"${___fle:r}.fifo2"
done >>! "$ZSRV_WORK_DIR/$ZSRV_ID".log 2>&1
} # ]]]
# FUNCTION: zi::wrap-track-functions [[[
zi::wrap-track-functions() {
# FUNCTION: .zinit-wrap-track-functions [[[
.zinit-wrap-track-functions() {
local user="$1" plugin="$2" id_as="$3" f
local -a wt
wt=( ${(@s.;.)ICE[wrap-track]} )
@ -86,14 +87,14 @@ zi::wrap-track-functions() {
eval "
function $f {
ZINIT[CUR_USR]=\"$user\" ZINIT[CUR_PLUGIN]=\"$plugin\" ZINIT[CUR_USPL2]=\"$id_as\"
zi::add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Starting to track function: $f ===\"
zi::diff \"\${ZINIT[CUR_USPL2]}\" begin
zi::tmp-subst-on load
.zinit-add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Starting to track function: $f ===\"
.zinit-diff \"\${ZINIT[CUR_USPL2]}\" begin
.zinit-tmp-subst-on load
functions[${f}]=\${functions[${f}-zinit-bkp]}
${f} \"\$@\"
zi::tmp-subst-off load
zi::diff \"\${ZINIT[CUR_USPL2]}\" end
zi::add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Ended tracking function: $f ===\"
.zinit-tmp-subst-off load
.zinit-diff \"\${ZINIT[CUR_USPL2]}\" end
.zinit-add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Ended tracking function: $f ===\"
ZINIT[CUR_USR]= ZINIT[CUR_PLUGIN]= ZINIT[CUR_USPL2]=
}"
done
@ -103,46 +104,52 @@ function $f {
# Dtrace
#
# FUNCTION: zi::clear-debug-report [[[
# Forgets dtrace repport gathered up to this moment.
zi::clear-debug-report() {
zi::clear-report-for _dtrace/_dtrace
} # ]]]
# FUNCTION: zi::debug-start [[[
# FUNCTION: .zinit-debug-start [[[
# Starts Dtrace, i.e. session tracking for changes in Zsh state.
zi::debug-start() {
.zinit-debug-start() {
if [[ ${ZINIT[DTRACE]} = 1 ]]; then
+zi::message "{error}Dtrace is already active, stop it first with \`dstop'{rst}"
+zinit-message "{error}Dtrace is already active, stop it first with \`dstop'{rst}"
return 1
fi
ZINIT[DTRACE]=1
zi::diff _dtrace/_dtrace begin
.zinit-diff _dtrace/_dtrace begin
# Full shadeing on
zi::tmp-subst-on dtrace
.zinit-tmp-subst-on dtrace
} # ]]]
# FUNCTION: zi::debug-stop [[[
# FUNCTION: .zinit-debug-stop [[[
# Stops Dtrace (i.e., session tracking for changes in Zsh state).
zi::debug-stop() {
.zinit-debug-stop() {
ZINIT[DTRACE]=0
# Shadowing fully off
zi::tmp-subst-off dtrace
.zinit-tmp-subst-off dtrace
# Gather end data now, for diffing later
zi::diff _dtrace/_dtrace end
.zinit-diff _dtrace/_dtrace end
} # ]]]
# FUNCTION: zi::debug-unload [[[
# FUNCTION: .zinit-clear-debug-report [[[
# Forgets dtrace repport gathered up to this moment.
.zinit-clear-debug-report() {
.zinit-clear-report-for _dtrace/_dtrace
} # ]]]
# FUNCTION: .zinit-debug-unload [[[
# Reverts changes detected by dtrace run.
zi::debug-unload() {
(( ${+functions[zi::unload]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
.zinit-debug-unload() {
(( ${+functions[.zinit-unload]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
if [[ ${ZINIT[DTRACE]} = 1 ]]; then
+zi::message "{error}Dtrace is still active, stop it first with \`dstop'{rst}"
+zinit-message "{error}Dtrace is still active, stop it first with \`dstop'{rst}"
else
zi::unload _dtrace _dtrace
.zinit-unload _dtrace _dtrace
fi
} # ]]]
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72:
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et foldmarker=[[[,]]] foldmethod=marker

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors
# Copyright (c) 2021-2022 zdharma-continuum and contributors
# FUNCTION: zi::any-colorify-as-uspl2 [[[
# FUNCTION: .zinit-any-colorify-as-uspl2 [[[
# Returns ANSI-colorified "user/plugin" string, from any supported
# plugin spec (user---plugin, user/plugin, user plugin, plugin).
#
@ -11,11 +11,11 @@
# $2 - plugin (only when $1 - i.e. user - given)
#
# $REPLY - ANSI-colorified "user/plugin" string
zi::any-colorify-as-uspl2() {
zi::any-to-user-plugin "$1" "$2"
.zinit-any-colorify-as-uspl2() {
.zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}"
if [[ "$user" = "%" ]]; then
zi::any-to-pid "" $plugin
.zinit-any-to-pid "" $plugin
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--plugins--/OMZP::}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--plugins/OMZP}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--lib--/OMZL::}"
@ -35,7 +35,7 @@ zi::any-colorify-as-uspl2() {
REPLY="${user:+${ZINIT[col-uname]}${user}${ZINIT[col-rst]}/}${ZINIT[col-pname]}${plugin}${ZINIT[col-rst]}"
fi
} # ]]]
# FUNCTION: zi::compute-ice [[[
# FUNCTION: .zinit-compute-ice [[[
# Computes ICE array
# - input
# - static
@ -55,14 +55,14 @@ zi::any-colorify-as-uspl2() {
# $6 - name of output string parameter, to hold is-snippet 0/1-bool ("is_snippet")
#
# $REPLY - snippet directory filepath
zi::compute-ice() {
.zinit-compute-ice() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob typesetsilent warncreateglobal noshortloops
local ___URL="${1%/}" ___pack="$2" ___is_snippet=0
local ___var_name1="${3:-ZINIT_ICE}" ___var_name2="${4:-local_dir}" ___var_name3="${5:-filename}" ___var_name4="${6:-is_snippet}"
# Copy from zi::recall
# Copy from .zinit-recall
local -a ice_order nval_ices
ice_order=(
${(s.|.)ZINIT[ice-list]}
@ -81,21 +81,21 @@ zi::compute-ice() {
___URL="${${___URL#"${___URL%%[! $'\t']*}"}%/}"
# snippet
zi::two-paths "$___URL"
.zinit-two-paths "$___URL"
local ___s_path="${reply[-4]}" ___s_svn="${reply[-3]}" ___path="${reply[-2]}" ___filename="${reply[-1]}" ___local_dir
if [[ -d "$___s_path" || -d "$___path" ]]; then
___is_snippet=1
else
# plugin
zi::any-to-user-plugin "$___URL" ""
.zinit-any-to-user-plugin "$___URL" ""
local ___user="${reply[-2]}" ___plugin="${reply[-1]}"
___s_path="" ___filename=""
[[ "$___user" = "%" ]] && ___path="$___plugin" || ___path="${ZINIT[PLUGINS_DIR]}/${___user:+${___user}---}${___plugin//\//---}"
zi::exists-physically-message "$___user" "$___plugin" || return 1
.zinit-exists-physically-message "$___user" "$___plugin" || return 1
fi
[[ $___pack = pack* ]] && (( ${#ICE} > 0 )) && zi::pack-ice "${___user-$___URL}" "$___plugin"
[[ $___pack = pack* ]] && (( ${#ICE} > 0 )) && .zinit-pack-ice "${___user-$___URL}" "$___plugin"
local -A ___sice
local -a ___tmp
@ -191,15 +191,15 @@ zi::compute-ice() {
return 0
} # ]]]
# FUNCTION: zi::countdown [[[
# FUNCTION: .zinit-countdown [[[
# Displays a countdown 5...4... etc.
#
# $REPLY - 1 if Ctrl-C is pressed, otherwise 0
zi::countdown() {
.zinit-countdown() {
(( !${+ICE[countdown]} )) && return 0
builtin emulate -L zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
trap "+zi::message \"{ehi}ABORTING, the ice {ice}$ice{ehi} not ran{rst}\"; return 1" INT
trap "+zinit-message \"{ehi}ABORTING, the ice {ice}$ice{ehi} not ran{rst}\"; return 1" INT
local count=5 ice tpe="$1"
@ -207,23 +207,23 @@ zi::countdown() {
[[ $tpe = "atpull" && $ice = "%atclone" ]] && ice="${ICE[atclone]}"
ice="{b}{ice}$tpe{ehi}:{rst}${ice//(#b)(\{[a-z0-9…_-]##\})/\\$match[1]}"
+zi::message -n "{hi}Running $ice{rst}{hi} ice in...{rst} "
+zinit-message -n "{hi}Running $ice{rst}{hi} ice in...{rst} "
while (( -- count + 1 )) {
+zi::message -n -- "{b}{error}"$(( count + 1 ))"{rst}{…}"
+zinit-message -n -- "{b}{error}"$(( count + 1 ))"{rst}{…}"
sleep 1
}
+zi::message -r -- "{b}{error}0 <running now>{rst}{…}"
+zinit-message -r -- "{b}{error}0 <running now>{rst}{…}"
return 0
} # ]]]
# FUNCTION: zi::exists-physically [[[
# FUNCTION: .zinit-exists-physically [[[
# Checks if directory of given plugin exists in PLUGIN_DIR.
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given)
zi::exists-physically() {
zi::any-to-user-plugin "$1" "$2"
.zinit-exists-physically() {
.zinit-any-to-user-plugin "$1" "$2"
if [[ ${reply[-2]} = % ]]; then
[[ -d ${reply[-1]} ]] && return 0 || return 1
else
@ -232,19 +232,19 @@ zi::exists-physically() {
|| return 1
fi
} # ]]]
# FUNCTION: zi::exists-physically-message [[[
# FUNCTION: .zinit-exists-physically-message [[[
# Checks if directory of given plugin exists in PLUGIN_DIR, and outputs error
# message if it doesn't.
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given)
zi::exists-physically-message() {
.zinit-exists-physically-message() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
builtin setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes
if ! zi::exists-physically "$1" "$2"; then
zi::any-to-user-plugin "$1" "$2"
if ! .zinit-exists-physically "$1" "$2"; then
.zinit-any-to-user-plugin "$1" "$2"
if [[ $reply[1] = % ]]; then
zi::any-to-pid "$1" "$2"
.zinit-any-to-pid "$1" "$2"
local spec1=$REPLY
if [[ $1 = %* ]]; then
local spec2=%${1#%}${${1#%}:+${2:+/}}$2
@ -254,32 +254,32 @@ zi::exists-physically-message() {
else
integer nospec=1
fi
zi::any-colorify-as-uspl2 "$1" "$2"
.zinit-any-colorify-as-uspl2 "$1" "$2"
+zi::message "{error}No such (plugin or snippet){rst}: $REPLY."
+zinit-message "{error}No such (plugin or snippet){rst}: $REPLY."
[[ $nospec -eq 0 && $spec1 != $spec2 ]] \
&& +zi::message "(expands to: {file}${spec2#%}{rst})."
&& +zinit-message "(expands to: {file}${spec2#%}{rst})."
return 1
fi
return 0
} # ]]]
# FUNCTION: zi::first [[[
# FUNCTION: .zinit-first [[[
# Finds the main file of plugin. There are multiple file name formats, they are
# ordered in order starting from more correct ones, and matched.
# zi::load-plugin() has similar code parts and doesn't call zi::first()
# for performance. Obscure matching is done in zi::find-other-matches, here
# and in zi::load(). Obscure = non-standard main-file naming convention.
# .zinit-load-plugin() has similar code parts and doesn't call .zinit-first()
# for performance. Obscure matching is done in .zinit-find-other-matches, here
# and in .zinit-load(). Obscure = non-standard main-file naming convention.
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given)
zi::first() {
zi::any-to-user-plugin "$1" "$2"
.zinit-first() {
.zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}"
zi::any-to-pid "$1" "$2"
zi::get-object-path plugin "$REPLY"
.zinit-any-to-pid "$1" "$2"
.zinit-get-object-path plugin "$REPLY"
integer ret=$?
local dname="$REPLY"
(( ret )) && { reply=( "$dname" "" ); return 1; }
@ -289,7 +289,7 @@ zi::first() {
if [[ -e "$dname/$plugin.plugin.zsh" ]]; then
reply=( "$dname/$plugin.plugin.zsh" )
else
zi::find-other-matches "$dname" "$plugin"
.zinit-find-other-matches "$dname" "$plugin"
fi
if [[ "${#reply}" -eq "0" ]]; then
@ -301,7 +301,7 @@ zi::first() {
reply=( "$dname" "${reply[-${#reply}]}" )
return 0
} # ]]]
# FUNCTION: zi::store-ices [[[
# FUNCTION: .zinit-store-ices [[[
# Saves ice mods in given hash onto disk.
#
# $1 - directory where to create or delete files
@ -310,7 +310,7 @@ zi::first() {
# $4 - additional keys of hash to store, empty-meaningful ices, space separated
# $5 URL, if applicable
# $6 mode, svn=1, 0=single file
zi::store-ices() {
.zinit-store-ices() {
local ___pfx="$1" ___ice_var="$2" ___add_ices="$3" ___add_ices2="$4"
local url="$5" mode="$6"
@ -353,13 +353,13 @@ zi::store-ices() {
[[ -n "${(P)___key}" ]] && builtin print -r -- "${(P)___key}" >! "$___pfx"/"$___key"
done
} # ]]]
# FUNCTION: zi::two-paths [[[
# FUNCTION: .zinit-two-paths [[[
# Obtains a snippet URL without specification if it is an SVN URL (points to
# directory) or regular URL (points to file), returns 2 possible paths for
# further examination
#
# $REPLY - two filepaths
zi::two-paths() {
.zinit-two-paths() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob typesetsilent warncreateglobal noshortloops
@ -371,16 +371,16 @@ zi::two-paths() {
url1=$url
url2=$url
zi::get-object-path snippet "$url1"
.zinit-get-object-path snippet "$url1"
local_dirA=$reply[-3] dirnameA=$reply[-2]
[[ -d "$local_dirA/$dirnameA/.svn" ]] && {
svn_dirA=".svn"
if { zi::first % "$local_dirA/$dirnameA"; } {
if { .zinit-first % "$local_dirA/$dirnameA"; } {
fileB_there=( ${reply[-1]} )
}
}
zi::get-object-path snippet "$url2"
.zinit-get-object-path snippet "$url2"
local_dirB=$reply[-3] dirnameB=$reply[-2]
[[ -z $svn_dirA ]] && fileB_there=( "$local_dirB/$dirnameB"/*~*.(zwc|md|js|html)(.-DOnN[1]) )
@ -388,4 +388,10 @@ zi::two-paths() {
reply=( "$local_dirA/$dirnameA" "$svn_dirA" "$local_dirB/$dirnameB" "${fileB_there[1]##$local_dirB/$dirnameB/#}" )
} # ]]]
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 :
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et foldmarker=[[[,]]] foldmethod=marker

773
zinit.zsh

File diff suppressed because it is too large Load diff