Skip to content

Commit 96eb2e3

Browse files
committed
driver: Fix "_zsh_highlight:3: read-only variable: ret" warnings when POSIX_BUILTINS is set.
Fixes #719. Cf. #688.
1 parent 291634e commit 96eb2e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zsh-syntax-highlighting.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ typeset -ga ZSH_HIGHLIGHT_HIGHLIGHTERS
7272
_zsh_highlight()
7373
{
7474
# Store the previous command return code to restore it whatever happens.
75-
readonly ret=$?
75+
local ret=$?
76+
# Make it read-only. Can't combine this with the previous line when POSIX_BUILTINS may be set.
77+
typeset -r ret
7678

7779
# Remove all highlighting in isearch, so that only the underlining done by zsh itself remains.
7880
# For details see FAQ entry 'Why does syntax highlighting not work while searching history?'.

0 commit comments

Comments
 (0)