Merge pull request #1445 from davidpfarrell/soft-separator

Adds soft-separator support to powerline main + multiline themes
This commit is contained in:
Nils Winkler
2019-12-28 13:15:21 +01:00
committed by GitHub
6 changed files with 24 additions and 2 deletions

View File

@@ -42,6 +42,10 @@ You can change the format using the following variable:
The time/date is printed by the `date` command, so refer to its man page to change the format.
### Soft Separators
Adjacent segments having the same background color will use a less-pronouced (i.e. soft) separator between them.
### Segment Order
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:

View File

@@ -175,10 +175,15 @@ function __powerline_left_segment {
local params=( $1 )
IFS="${OLD_IFS}"
local separator_char="${POWERLINE_LEFT_SEPARATOR}"
local separator_char_soft="${POWERLINE_LEFT_SEPARATOR_SOFT}"
local separator=""
if [[ "${SEGMENTS_AT_LEFT}" -gt 0 ]]; then
separator="$(set_color ${LAST_SEGMENT_COLOR} ${params[1]})${separator_char}${normal}"
if [[ "${LAST_SEGMENT_COLOR}" -eq "${params[1]}" ]]; then
separator="$(set_color - ${LAST_SEGMENT_COLOR})${separator_char_soft}${normal}"
else
separator="$(set_color ${LAST_SEGMENT_COLOR} ${params[1]})${separator_char}${normal}"
fi
fi
LEFT_PROMPT+="${separator}$(set_color - ${params[1]}) ${params[0]} ${normal}"
LAST_SEGMENT_COLOR=${params[1]}

View File

@@ -4,6 +4,7 @@
PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
POWERLINE_LEFT_SEPARATOR_SOFT=${POWERLINE_LEFT_SEPARATOR_SOFT:=""}
USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "}
USER_INFO_THEME_PROMPT_COLOR=${POWERLINE_USER_INFO_COLOR:=32}