From d76093a3dfd2a9c85f2773b07ec1a7b37338ab31 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 21 Jan 2022 21:09:05 +0900 Subject: [PATCH] plugins/bashmarks: Use global color variables --- lib/omb-deprecate.sh | 6 ++++++ plugins/bashmarks/bashmarks.plugin.sh | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/omb-deprecate.sh b/lib/omb-deprecate.sh index 11c8269..9b5ac2b 100644 --- a/lib/omb-deprecate.sh +++ b/lib/omb-deprecate.sh @@ -285,6 +285,12 @@ _omb_deprecate_function 20000 e_underline _omb_log_underline _omb_deprecate_function 20000 e_bold _omb_log_bold _omb_deprecate_function 20000 e_note _omb_log_note +# plugins/bashmarks/bashmarks.plugin.sh [ This anyway conflicts with +# variables defined by themes (axin, mairan, sexy, etc.) so do not +# define fallbacks and warnings. ] +#_omb_deprecate_const RED "0;31m" "Please use '\${_omb_term_red:2}'." +#_omb_deprecate_const GREEN "0;33m" "Please use '\${_omb_term_green:2}'." + # themes/* _omb_deprecate_function 20000 prompt_command _omb_theme_PROMPT_COMMAND _omb_deprecate_function 20000 prompt _omb_theme_PROMPT_COMMAND diff --git a/plugins/bashmarks/bashmarks.plugin.sh b/plugins/bashmarks/bashmarks.plugin.sh index e79469e..8f56c3f 100644 --- a/plugins/bashmarks/bashmarks.plugin.sh +++ b/plugins/bashmarks/bashmarks.plugin.sh @@ -39,9 +39,6 @@ if [ ! -n "$SDIRS" ]; then fi touch $SDIRS -RED="0;31m" -GREEN="0;33m" - # main function function bm { option="${1}" @@ -125,9 +122,9 @@ function _goto_bookmark { if [ -d "$target" ]; then cd "$target" elif [ ! -n "$target" ]; then - echo -e "\033[${RED}WARNING: '${1}' bashmark does not exist\033[00m" + printf '%s\n' "${_omb_term_red}WARNING: '${1}' bashmark does not exist${_omb_term_reset}" else - echo -e "\033[${RED}WARNING: '${target}' does not exist\033[00m" + printf '%s\n' "${_omb_term_red}WARNING: '${target}' does not exist${_omb_term_reset}" fi }