From 96eb2e31a192968c376ce74ca5ab09c094d1d082 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 3 Apr 2020 01:19:38 +0000 Subject: [PATCH] driver: Fix "_zsh_highlight:3: read-only variable: ret" warnings when POSIX_BUILTINS is set. Fixes #719. Cf. #688. --- zsh-syntax-highlighting.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index a87a63c..7944b0f 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -72,7 +72,9 @@ typeset -ga ZSH_HIGHLIGHT_HIGHLIGHTERS _zsh_highlight() { # Store the previous command return code to restore it whatever happens. - readonly ret=$? + local ret=$? + # Make it read-only. Can't combine this with the previous line when POSIX_BUILTINS may be set. + typeset -r ret # Remove all highlighting in isearch, so that only the underlining done by zsh itself remains. # For details see FAQ entry 'Why does syntax highlighting not work while searching history?'.