Skip to content

Commit 46a299f

Browse files
committed
🐛 Disable when ble.sh is enabled
1 parent a513e8f commit 46a299f

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ manager, it can be installed correctly.
5959
. /the/path/of/this/plugin/zsh-colorize-functions.plugin.zsh
6060
```
6161

62+
## Tips
63+
64+
This plugin [conflicts](https://github.com/akinomyoga/ble.sh/discussions/465)
65+
with [ble.sh](https://github.com/akinomyoga/ble.sh).
66+
6267
## Similar Projects
6368

6469
- [zsh-help](https://github.com/Freed-Wu/zsh-help): colorize `XXX --help`.

zsh-colorize-functions.plugin.zsh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,21 @@ if has_cmd bat; then
3535
alias declare=\declare
3636
unfunction has_cmd
3737
else
38-
function declare() {
39-
local arg
40-
local -i is_colorize=1
41-
for arg; do
42-
[[ $arg != -f ]] && is_colorize=0 && break
43-
done
44-
if ((is_colorize)) ; then
45-
builtin declare "$@" | bat -pplbash
46-
else
47-
builtin declare "$@"
48-
fi
49-
}
38+
# https://github.com/akinomyoga/ble.sh/discussions/465
39+
if [[ ! ${BLE_VERSION-} ]]; then
40+
function declare() {
41+
local arg
42+
local -i is_colorize=1
43+
for arg; do
44+
[[ $arg != -f ]] && is_colorize=0 && break
45+
done
46+
if ((is_colorize)) ; then
47+
builtin declare "$@" | bat -pplbash
48+
else
49+
builtin declare "$@"
50+
fi
51+
}
52+
fi
5053
unset has_cmd
5154
fi
5255
fi

0 commit comments

Comments
 (0)