Merge pull request #1883 from seefood/ira/autosave-history-plml

Add history flushes on each command to the powerline themes
pull/1975/head
Noah Gorny 2021-10-17 19:51:56 +03:00 committed by GitHub
commit 7987e4bfcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,8 @@ function __powerline_prompt_command {
SEGMENTS_AT_RIGHT=0 SEGMENTS_AT_RIGHT=0
LAST_SEGMENT_COLOR="" LAST_SEGMENT_COLOR=""
_save-and-reload-history "${HISTORY_AUTOSAVE:-0}"
## left prompt ## ## left prompt ##
for segment in $POWERLINE_LEFT_PROMPT; do for segment in $POWERLINE_LEFT_PROMPT; do
local info="$(__powerline_${segment}_prompt)" local info="$(__powerline_${segment}_prompt)"

View File

@ -26,6 +26,8 @@ function __powerline_left_segment {
LEFT_PROMPT+="$(set_color ${params[1]} -)${pad_before_segment}${params[0]}${normal}" LEFT_PROMPT+="$(set_color ${params[1]} -)${pad_before_segment}${params[0]}${normal}"
LAST_SEGMENT_COLOR=${params[1]} LAST_SEGMENT_COLOR=${params[1]}
(( SEGMENTS_AT_LEFT += 1 )) (( SEGMENTS_AT_LEFT += 1 ))
_save-and-reload-history "${HISTORY_AUTOSAVE:-0}"
} }
function __powerline_left_last_segment_padding { function __powerline_left_last_segment_padding {

View File

@ -275,6 +275,8 @@ function __powerline_prompt_command() {
SEGMENTS_AT_LEFT=0 SEGMENTS_AT_LEFT=0
LAST_SEGMENT_COLOR="" LAST_SEGMENT_COLOR=""
save-and-reload-history "${HISTORY_AUTOSAVE:-0}"
if [[ -n "${POWERLINE_PROMPT_DISTRO_LOGO}" ]]; then if [[ -n "${POWERLINE_PROMPT_DISTRO_LOGO}" ]]; then
LEFT_PROMPT+="$(set_color "${PROMPT_DISTRO_LOGO_COLOR}" "${PROMPT_DISTRO_LOGO_COLORBG}")${PROMPT_DISTRO_LOGO}$(set_color - -)" LEFT_PROMPT+="$(set_color "${PROMPT_DISTRO_LOGO_COLOR}" "${PROMPT_DISTRO_LOGO_COLORBG}")${PROMPT_DISTRO_LOGO}$(set_color - -)"
fi fi