summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Misc/add-zle-hook-widget8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 866e2add1..2f8f5b7a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
 	* 39122: Completion/Unix/Command/_git: __git_recent_branches:
 	Silence warning on an edge case.
 
+2016-08-30  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 39131: Functions/Misc/add-zle-hook-widget: return on error
+	needs to be at the outer scope.
+
 2016-08-30  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 39108: Completion/Unix/Command/_postfix: Support
diff --git a/Functions/Misc/add-zle-hook-widget b/Functions/Misc/add-zle-hook-widget
index c47d9a3cb..572de2561 100644
--- a/Functions/Misc/add-zle-hook-widget
+++ b/Functions/Misc/add-zle-hook-widget
@@ -18,10 +18,6 @@
 #
 # The -L option lists the hooks and their associated widgets.
 
-() { # Preserve caller global option settings
-
-emulate -L zsh
-
 # This is probably more safeguarding than necessary
 zmodload -e zsh/zle || return 1
 { zmodload zsh/parameter && zmodload zsh/zleparameter } || {
@@ -29,6 +25,10 @@ zmodload -e zsh/zle || return 1
     return 1
 }
 
+() { # Preserve caller global option settings
+
+emulate -L zsh
+
 # Setup - create the base functions for hook widgets that call the others
 
 local -a hooktypes=( zle-isearch-exit zle-isearch-update