Skip to content

Commit 4dac816

Browse files
committed
[zsh] snipe: better handling for jj projects
1 parent e95fb24 commit 4dac816

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

zsh/.config/zsh/.zsh-custom/themes/snipe.zsh-theme

+10-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,16 @@ function _git_pushable() {
5959
_vcs_info_wrapper() {
6060
vcs_info
6161
if echo "${vcs_info_msg_0_}" | grep -qE 'jj/keep'; then
62-
echo "@" # controlled by jujutsu
62+
line="$(jj log -r @ --no-graph)"
63+
if echo "$line" | grep -q "(empty)"; then
64+
echo -e "%F{002}$(echo "$line" | cut -d' ' -f1)%{$reset_color%}"
65+
elif echo "$line" | grep -q "(no description set)"; then
66+
echo -e "%F{003}$(echo "$line" | cut -d' ' -f1)%{$reset_color%}"
67+
else
68+
echo "$line" | cut -d' ' -f1
69+
fi
6370
else
64-
echo "${vcs_info_msg_0_}"
71+
echo "%F{green}${vcs_info_msg_0_}%{$reset_color%}"
6572
fi
6673
}
6774

@@ -152,7 +159,7 @@ function generate_lpropmpt() {
152159
if [[ -n "$TMUX" ]] ; then
153160
PROMPT_GREPPER=" "
154161
fi
155-
echo "${${KEYMAP/vicmd/$NORMAL_COLOR}/(main|viins)/$INSERT_COLOR}${_return_status}${_tmux_indicator}%F{green}$( _vcs_info_wrapper )%F{yellow}%B%(1j.#.)%{$reset_color%}$PROMPT_GREPPER"
162+
echo "${${KEYMAP/vicmd/$NORMAL_COLOR}/(main|viins)/$INSERT_COLOR}${_return_status}${_tmux_indicator}$( _vcs_info_wrapper )%F{yellow}%B%(1j.#.)%{$reset_color%}$PROMPT_GREPPER"
156163
}
157164

158165
function generate_rpropmpt() {

0 commit comments

Comments
 (0)