1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-24 13:10:07 +00:00

quote $foo when running with unknown options; fixes #453

This commit is contained in:
romkatv 2020-02-01 22:03:42 +01:00
parent c08d1e846b
commit eb9da89ad9
5 changed files with 19 additions and 19 deletions

View file

@ -59,7 +59,7 @@ function _p9k_can_configure() {
}
function p9k_configure() {
eval $__p9k_intro
eval "$__p9k_intro"
(
set -- -f
source $__p9k_root_dir/internal/wizard.zsh

View file

@ -1,4 +1,4 @@
if [[ $__p9k_sourced != 3 ]]; then
if [[ $__p9k_sourced != 4 ]]; then
>&2 print -P ""
>&2 print -P "[%F{1}ERROR%f]: Corrupted powerlevel10k installation."
>&2 print -P ""
@ -112,7 +112,7 @@ typeset -grA __p9k_colors=(
#
# Type `getColorCode background` or `getColorCode foreground` to see the list of predefined colors.
function getColorCode() {
eval $__p9k_intro
eval "$__p9k_intro"
if (( ARGC == 1 )); then
case $1 in
foreground)
@ -139,7 +139,7 @@ function getColorCode() {
# Sadly, this is a part of public API. Its use is emphatically discouraged.
function print_icon() {
eval $__p9k_intro
eval "$__p9k_intro"
(( $+functions[_p9k_print_icon] )) || source "${__p9k_root_dir}/internal/icons.zsh"
_p9k_print_icon "$@"
}
@ -150,7 +150,7 @@ function print_icon() {
# otherwise "print_icon" is used, which takes the users
# overrides into account.
function get_icon_names() {
eval $__p9k_intro
eval "$__p9k_intro"
(( $+functions[_p9k_get_icon_names] )) || source "${__p9k_root_dir}/internal/icons.zsh"
_p9k_get_icon_names "$@"
}
@ -3589,7 +3589,7 @@ function _p9k_maybe_ignore_git_repo() {
}
function _p9k_vcs_resume() {
eval $__p9k_intro
eval "$__p9k_intro"
_p9k_maybe_ignore_git_repo
@ -5215,7 +5215,7 @@ function _p9k_on_expand() {
(( _p9k__expanded && ! $+__p9k_instant_prompt_active )) && return
() {
eval $__p9k_intro
eval "$__p9k_intro"
_p9k_maybe_dump
(( $+__p9k_instant_prompt_active )) && _p9k_clear_instant_prompt
@ -5305,7 +5305,7 @@ function _p9k_on_expand() {
functions -M _p9k_on_expand
_p9k_precmd_impl() {
eval $__p9k_intro
eval "$__p9k_intro"
(( __p9k_enabled )) || return
@ -5404,7 +5404,7 @@ _p9k_precmd_impl() {
_p9k_trapint() {
if (( __p9k_enabled )); then
eval $__p9k_intro
eval "$__p9k_intro"
zle && _p9k_on_widget_zle-line-finish int
fi
return 0
@ -6023,7 +6023,7 @@ function _p9k_widget_hook() {
fi
fi
eval $__p9k_intro
eval "$__p9k_intro"
(( _p9k__restore_prompt_fd )) && _p9k_restore_prompt $_p9k__restore_prompt_fd
__p9k_reset_state=1
local pat idx var
@ -6097,7 +6097,7 @@ function _p9k_wrap_widgets() {
}
function _p9k_restore_prompt() {
eval $__p9k_intro
eval "$__p9k_intro"
{
(( _p9k__must_restore_prompt )) || return
_p9k__must_restore_prompt=0
@ -6891,7 +6891,7 @@ _p9k_setup() {
prompt_opts+=cr
fi
eval $__p9k_intro
eval "$__p9k_intro"
prompt_powerlevel9k_teardown
__p9k_enabled=1
typeset -ga preexec_functions=(_p9k_preexec1 $preexec_functions _p9k_preexec2)
@ -6901,7 +6901,7 @@ _p9k_setup() {
prompt_powerlevel9k_setup() { _p9k_setup }
prompt_powerlevel9k_teardown() {
eval $__p9k_intro
eval "$__p9k_intro"
add-zsh-hook -D precmd '(_p9k_|powerlevel9k_)*'
add-zsh-hook -D preexec '(_p9k_|powerlevel9k_)*'
PROMPT='%m%# '
@ -7069,7 +7069,7 @@ typeset -gi __p9k_reset_state
function p10k() {
[[ $# != 1 || $1 != finalize ]] || { p10k-instant-prompt-finalize; return 0 }
eval $__p9k_intro
eval "$__p9k_intro"
if (( !ARGC )); then
print -rP -- $__p9k_p10k_usage >&2

View file

@ -141,7 +141,7 @@ function _p9k_parse_buffer() {
local rcquotes
[[ -o rcquotes ]] && rcquotes=rcquotes
eval $__p9k_intro
eval "$__p9k_intro"
setopt no_nomatch $rcquotes
typeset -ga P9K_COMMANDS=()

View file

@ -85,7 +85,7 @@ function _p9k_worker_invoke() {
}
function _p9k_worker_cleanup() {
eval $__p9k_intro
eval "$__p9k_intro"
[[ $_p9k__worker_shell_pid == $sysparams[pid] ]] && _p9k_worker_stop
return 0
}
@ -106,7 +106,7 @@ function _p9k_worker_stop() {
}
function _p9k_worker_receive() {
eval $__p9k_intro
eval "$__p9k_intro"
[[ -z $_p9k__worker_resp_fd ]] && return

View file

@ -26,7 +26,7 @@
[[ -z $_p9k_locale ]] || local LC_ALL=$_p9k_locale'
() {
eval $__p9k_intro
eval "$__p9k_intro"
if (( $+__p9k_sourced )); then
(( $+functions[_p9k_setup] )) && _p9k_setup
return 0
@ -35,7 +35,7 @@
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit
fi
typeset -gr __p9k_sourced=3
typeset -gr __p9k_sourced=4
if [[ -w $__p9k_root_dir && -w $__p9k_root_dir/internal && -w $__p9k_root_dir/gitstatus && ${(%):-%#} == % ]]; then
local f
for f in $__p9k_root_dir/{powerlevel9k.zsh-theme,powerlevel10k.zsh-theme,internal/p10k.zsh,internal/icons.zsh,internal/configure.zsh,internal/worker.zsh,internal/parser.zsh,gitstatus/gitstatus.plugin.zsh}; do