feat(magic-enter plugin): Add support for jj to magic-enter plugin (#13241)
Diff
1diff --git a/plugins/magic-enter/magic-enter.plugin.zsh b/plugins/magic-enter/magic-enter.plugin.zsh
2index 55b893535ca3895ea91de3687acaf17dd1b650a8..c3175b70b1016079cb9e758922644ec5b2f64309 100644
3--- a/plugins/magic-enter/magic-enter.plugin.zsh
4+++ b/plugins/magic-enter/magic-enter.plugin.zsh
5@@ -1,5 +1,6 @@
6 # Default commands
7 : ${MAGIC_ENTER_GIT_COMMAND:="git status -u ."} # run when in a git repository
8+: ${MAGIC_ENTER_JJ_COMMAND:="jj st --no-pager ."} # run when in a jj repository
9 : ${MAGIC_ENTER_OTHER_COMMAND:="ls -lh ."} # run anywhere else
1011 magic-enter() {
12@@ -9,7 +10,9 @@ magic-enter() {
13 return
14 fi
1516- if command git rev-parse --is-inside-work-tree &>/dev/null; then
17+ if command jj st &>/dev/null; then # needs to be before git to handle colocated repositories
18+ BUFFER="$MAGIC_ENTER_JJ_COMMAND"
19+ elif command git rev-parse --is-inside-work-tree &>/dev/null; then
20 BUFFER="$MAGIC_ENTER_GIT_COMMAND"
21 else
22 BUFFER="$MAGIC_ENTER_OTHER_COMMAND"