about summary refs log tree commit diff
path: root/Functions/Zle/replace-string-again
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-11-04 14:31:23 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-11-04 14:31:23 +0000
commita6e039e12e5b9e480b876971ff644c3180efb2bc (patch)
treea6f25cf495e08c034b265354d3415a44827741a7 /Functions/Zle/replace-string-again
parent45faf8f5b2758a638e0958928262ca9d26980885 (diff)
downloadzsh-a6e039e12e5b9e480b876971ff644c3180efb2bc.tar.gz
zsh-a6e039e12e5b9e480b876971ff644c3180efb2bc.tar.xz
zsh-a6e039e12e5b9e480b876971ff644c3180efb2bc.zip
29892: fix regular expression replacements in replace-string
improve variable save and restore in read-from-minibuffer
Diffstat (limited to 'Functions/Zle/replace-string-again')
-rw-r--r--Functions/Zle/replace-string-again6
1 files changed, 4 insertions, 2 deletions
diff --git a/Functions/Zle/replace-string-again b/Functions/Zle/replace-string-again
index f24c14f88..dac3db755 100644
--- a/Functions/Zle/replace-string-again
+++ b/Functions/Zle/replace-string-again
@@ -40,8 +40,10 @@ if [[ $curwidget = *(pattern|regex)* ]]; then
     rep2+=$rep
     if [[ $curwidget = *regex* ]]; then
       autoload -Uz regexp-replace
-      regexp-replace LBUFFER $_replace_string_src $rep2 || return 1
-      regexp-replace RBUFFER $_replace_string_src $rep2 || return 1
+      integer ret=1
+      regexp-replace LBUFFER $_replace_string_src $rep2 && ret=0
+      regexp-replace RBUFFER $_replace_string_src $rep2 && ret=0
+      return ret
     else
       LBUFFER=${LBUFFER//(#bm)$~_replace_string_src/${(e)rep2}}
       RBUFFER=${RBUFFER//(#bm)$~_replace_string_src/${(e)rep2}}