about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Misc/zed2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ee10830c9..58d17e5d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-09  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 40126: Functions/Misc/zed: zed (fned): When editing a new
+	function. escape its name.
+
 2016-12-08  Oliver Kiddle  <opk@zsh.org>
 
 	* 40130: NEWS: mention some changes since 5.2
diff --git a/Functions/Misc/zed b/Functions/Misc/zed
index 0ea90c7df..77d392bc3 100644
--- a/Functions/Misc/zed
+++ b/Functions/Misc/zed
@@ -76,7 +76,7 @@ if ((fun)) then
   if [[ $var = *\#\ undefined* ]] then
     var="$(autoload +X $1; functions -- $1)"
   elif [[ -z $var ]] then
-    var="$1() {
+    var="${(q-)1} () {
 }"
   fi
   vared -M zed -m zed-vicmd var && eval function "$var"