Add underscore to non-API functions and variables

This commit is contained in:
ZyX 2014-01-30 00:44:32 +04:00
parent dc33c36098
commit bc856987ff
1 changed files with 10 additions and 10 deletions

View File

@ -50,9 +50,9 @@ _powerline_setup_prompt() {
chpwd_functions+=( _powerline_tmux_set_pwd )
_powerline_set_true_keymap_name "${${(Q)${${(z)${"$(bindkey -lL main)"}}[3]}}:-.safe}"
if zmodload zsh/zpython &>/dev/null ; then
zpython 'from powerline.bindings.zsh import setup as powerline_setup'
zpython 'powerline_setup()'
zpython 'del powerline_setup'
zpython 'from powerline.bindings.zsh import setup as _powerline_setup'
zpython '_powerline_setup()'
zpython 'del _powerline_setup'
else
local add_args='--last_exit_code=$? --last_pipe_status="$pipestatus"'
add_args+=' --jobnum=$_POWERLINE_JOBNUM'
@ -70,7 +70,7 @@ _powerline_add_widget() {
elif [[ -z "$old_widget_command" ]] ; then
zle -N $widget $function
else
local save_widget="powerline_save_$widget"
local save_widget="_powerline_save_$widget"
local -i i=0
while ! test -z "$(zle -l -L $save_widget)" ; do
save_widget="${save_widget}_$i"
@ -81,13 +81,13 @@ _powerline_add_widget() {
eval "function $save_widget() { emulate -L zsh; $widget \$@ }"
eval "${old_widget_command/$widget/$save_widget}"
zle -N $widget $function
export POWERLINE_SAVE_WIDGET="$save_widget"
export _POWERLINE_SAVE_WIDGET="$save_widget"
fi
}
_powerline_set_true_keymap_name() {
export POWERLINE_MODE="${1}"
local plm_bk="$(bindkey -lL ${POWERLINE_MODE})"
export _POWERLINE_MODE="${1}"
local plm_bk="$(bindkey -lL ${_POWERLINE_MODE})"
if [[ $plm_bk = 'bindkey -A'* ]] ; then
_powerline_set_true_keymap_name ${(Q)${${(z)plm_bk}[3]}}
fi
@ -96,14 +96,14 @@ _powerline_set_true_keymap_name() {
_powerline_zle_keymap_select() {
_powerline_set_true_keymap_name $KEYMAP
zle reset-prompt
test -z "$POWERLINE_SAVE_WIDGET" || zle $POWERLINE_SAVE_WIDGET
test -z "$_POWERLINE_SAVE_WIDGET" || zle $_POWERLINE_SAVE_WIDGET
}
_powerline_add_widget zle-keymap-select _powerline_zle_keymap_select
_powerline_precmd
if [[ "$POWERLINE_MODE" != vi* ]] ; then
export POWERLINE_DEFAULT_MODE="$POWERLINE_MODE"
if [[ "$_POWERLINE_MODE" != vi* ]] ; then
export _POWERLINE_DEFAULT_MODE="$_POWERLINE_MODE"
fi
trap "_powerline_tmux_set_columns" SIGWINCH