about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-08-28 08:43:12 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-08-28 08:43:12 +0000
commit8e6076fdded0be53efa1d1c5735b1a1e2aa8d70e (patch)
treef306269bcfda726681021127f8fe874531a3ee4d /Src/Zle
parenta03acf0ca2792562e3d7089b69763a3938b18769 (diff)
downloadzsh-8e6076fdded0be53efa1d1c5735b1a1e2aa8d70e.tar.gz
zsh-8e6076fdded0be53efa1d1c5735b1a1e2aa8d70e.tar.xz
zsh-8e6076fdded0be53efa1d1c5735b1a1e2aa8d70e.zip
15717
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_misc.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index fef55f01d..e24d0c08b 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -57,7 +57,7 @@ doinsert(char *str)
 }
 
 /**/
-int
+mod_export int
 selfinsert(char **args)
 {
     char s[3], *p = s;
@@ -542,6 +542,32 @@ copyprevword(char **args)
 
 /**/
 int
+copyprevshellword(char **args)
+{
+    LinkList l;
+    LinkNode n;
+    int i;
+    char *p = NULL;
+
+    if ((l = bufferwords(NULL, NULL, &i)))
+        for (n = firstnode(l); n; incnode(n))
+            if (!i--) {
+                p = getdata(n);
+                break;
+            }
+
+    if (p) {
+	int len = strlen(p);
+
+	spaceinline(len);
+	memcpy(line + cs, p, len);
+	cs += len;
+    }
+    return 0;
+}
+
+/**/
+int
 sendbreak(char **args)
 {
     errflag = 1;