Merge pull request #1117 from edubxb/fix-powerline-user-info

Fix some regressions in Powerline theme
pull/1118/head
Nils Winkler 2017-12-18 11:45:19 +01:00 committed by GitHub
commit 8c89381762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -14,14 +14,19 @@ function set_color {
}
function __powerline_user_info_prompt {
local user_info=${USER}
local user_info=""
local color=${USER_INFO_THEME_PROMPT_COLOR}
if [[ "${THEME_CHECK_SUDO}" = true ]]; then
if sudo -n uptime 2>&1 | grep -q "load"; then
color=${USER_INFO_THEME_PROMPT_COLOR_SUDO}
fi
fi
case "${POWERLINE_PROMPT_USER_INFO_MODE}" in
"sudo")
if sudo -n true >/dev/null 2>&1; then
color=${USER_INFO_THEME_PROMPT_COLOR_SUDO}
user_info=${USER_INFO_SUDO_CHAR}${USER}
if [[ "${color}" = "${USER_INFO_THEME_PROMPT_COLOR_SUDO}" ]]; then
user_info="!"
fi
;;
*)
@ -87,10 +92,6 @@ function __powerline_scm_prompt {
function __powerline_cwd_prompt {
local cwd=$(pwd | sed "s|^${HOME}|~|")
#if [[ -n "${CWD_THEME_DIR_SEPARATOR}" ]]; then
# todo
#fi
echo "${cwd}|${CWD_THEME_PROMPT_COLOR}"
}