From 65e9c940b76a4e9bfe2a30b7873c74c687d40f63 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Sun, 22 Oct 2023 13:15:58 +0300 Subject: move venv after working dir and before git placing venv-info makes more sense with git-info --- prompt_adam3_setup | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/prompt_adam3_setup b/prompt_adam3_setup index 6667d40..8cb8afa 100644 --- a/prompt_adam3_setup +++ b/prompt_adam3_setup @@ -169,11 +169,11 @@ prompt_adam3_precmd () { # vcs vcs_info #$vcs_info_msg_0_ - local prom preprom - (( ${+VIRTUAL_ENV} )) && preprom="${PROMPT_ADAM3_VENV/SUBSTITUTE/${VIRTUAL_ENV:t}} " - preprom+=${PROMPT_ADAM3_PS1} - prom=${preprom} + local prom venv_info + (( ${+VIRTUAL_ENV} )) && venv_info="${PROMPT_ADAM3_VENV/SUBSTITUTE/${VIRTUAL_ENV:t}} " + prom=${PROMPT_ADAM3_PS1} prom+=$PROMPT_ADAM3_SLM_DIR + prom+=$venv_info prom+=$vcs_info_msg_0_ prom+=$PROMPT_ADAM3_PROMPTCHAR @@ -184,7 +184,7 @@ prompt_adam3_precmd () { # If the prompt is over half the terminal, we go into multiline-mode. if (( prompt_length > ( COLUMNS / 2 ) )); then - prom=$preprom # reset prompt + prom=${PROMPT_ADAM3_PS1} # reset prompt prom+=$PROMPT_ADAM3_DLM_DIR # double-line-mode dir # We need to recalculate prompt_length to know where to put time @@ -195,6 +195,7 @@ prompt_adam3_precmd () { # Add time. Left-pad with spaces. prom+=${(l:$timepadding:)PROMPT_ADAM3_RPS1} prom+=$'\n' # newline + prom+=$venv_info # virtualenv info prom+=$vcs_info_msg_0_ # vcs prom+=$PROMPT_ADAM3_PROMPTCHAR # promptchar RPS1= # RPS1 does not support multiline, so reset it when we're in multiline -- cgit v1.2.3