From d771fd88fb51142925a2ec8d1ad4580c713232bf Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 17 Apr 2017 16:29:31 -0500 Subject: [PATCH] [prompt] Range segment in eriner as in magicmace This reverts commit eee6e911d20d7de347eae7acfa6b6f635ffa2ac7. As suggested in https://github.com/Eriner/zim/pull/142#issuecomment-283806756 (and "thumb-upped" by Tmplt). The Ranger segment was introduced in eriner theme by Tmplt in https://github.com/Eriner/zim/pull/64. He also added it to the magicmace theme. --- modules/prompt/themes/eriner.zsh-theme | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/modules/prompt/themes/eriner.zsh-theme b/modules/prompt/themes/eriner.zsh-theme index ef4a1b9..bf5c940 100644 --- a/modules/prompt/themes/eriner.zsh-theme +++ b/modules/prompt/themes/eriner.zsh-theme @@ -42,13 +42,14 @@ prompt_eriner_end() { # Each component will draw itself, or hide itself if no information needs to be # shown. -# Status: Was there an error? Am I root? Are there background jobs? Who and -# where am I (user@hostname)? +# Status: Was there an error? Am I root? Are there background jobs? Ranger +# spawned shell? Who and where am I (user@hostname)? prompt_eriner_status() { local segment='' (( ${RETVAL} )) && segment+=' %F{red}✘' (( ${UID} == 0 )) && segment+=' %F{yellow}⚡' (( $(jobs -l | wc -l) > 0 )) && segment+=' %F{cyan}⚙' + (( ${RANGER_LEVEL} )) && segment+=' %F{cyan}r' if [[ ${USER} != ${DEFAULT_USER} || -n ${SSH_CLIENT} ]]; then segment+=' %F{%(!.yellow.default)}${USER}@%m' fi @@ -57,14 +58,6 @@ prompt_eriner_status() { fi } -# Ranger: , which can spawn a shell under its -# own process. -prompt_eriner_ranger() { - if (( ${RANGER_LEVEL} )); then - prompt_eriner_segment blue ' %F{black}r ' - fi -} - # Pwd: current working directory. prompt_eriner_pwd() { prompt_eriner_segment cyan " %F{black}$(short_pwd) " @@ -83,7 +76,6 @@ prompt_eriner_git() { prompt_eriner_main() { RETVAL=$? prompt_eriner_status - prompt_eriner_ranger prompt_eriner_pwd prompt_eriner_git prompt_eriner_end