Merge branch 'ira/autosave-history-plml' into ira/cleanup

* ira/autosave-history-plml:
  fix based on remarks on PR
pull/1970/head
Ira Abramov 2021-10-11 13:29:17 +03:00
commit 13265500e9
3 changed files with 7 additions and 2 deletions

View File

@ -62,11 +62,13 @@ function __powerline_prompt_command {
SEGMENTS_AT_LEFT=0
SEGMENTS_AT_RIGHT=0
LAST_SEGMENT_COLOR=""
_save-and-reload-history "${HISTORY_AUTOSAVE:-0}"
## left prompt ##
for segment in $POWERLINE_LEFT_PROMPT; do
local info="$(__powerline_"${segment}"_prompt)"
local info
info="$(__powerline_"${segment}"_prompt)"
[[ -n "${info}" ]] && __powerline_left_segment "${info}"
done
@ -80,7 +82,8 @@ function __powerline_prompt_command {
if [[ -n "${POWERLINE_RIGHT_PROMPT}" ]]; then
# LEFT_PROMPT+="${move_cursor_rightmost}"
for segment in $POWERLINE_RIGHT_PROMPT; do
local info="$(__powerline_"${segment}"_prompt)"
local info
info="$(__powerline_"${segment}"_prompt)"
[[ -n "${info}" ]] && __powerline_right_segment "${info}"
done

View File

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

View File

@ -274,6 +274,7 @@ function __powerline_prompt_command() {
LEFT_PROMPT=""
SEGMENTS_AT_LEFT=0
LAST_SEGMENT_COLOR=""
save-and-reload-history "${HISTORY_AUTOSAVE:-0}"
if [[ -n "${POWERLINE_PROMPT_DISTRO_LOGO}" ]]; then