added a function instead running the same check and commands in every theme

pull/1379/head
Levent Yalcin 2019-06-10 13:39:35 +01:00
parent 23fab13d85
commit e93cc67bcd
No known key found for this signature in database
GPG Key ID: 26426B2D80C07FBE
2 changed files with 6 additions and 1 deletions

View File

@ -497,3 +497,8 @@ function safe_append_prompt_command {
fi
fi
}
function _save-and-reload-history() {
local autosave=${1:-0}
[[ $autosave -eq 1 ]] && history -a && history -c && history -r
}

View File

@ -14,7 +14,7 @@ function __powerline_prompt_command {
LEFT_PROMPT=""
[[ $HISTORY_AUTOSAVE -eq 1 ]] && history -a && history -c && history -r
_save-and-reload-history "${HISTORY_AUTOSAVE:-0}"
## left prompt ##
for segment in $POWERLINE_PROMPT; do