summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 09:55:31 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 09:55:31 +0000
commita295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3 (patch)
treeeb354def4bb31fa8dc1fd6a2b8a178d1f1936f7c /Src
parent2769b198812abf82cc3b074852714959213f266a (diff)
downloadzsh-a295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3.tar.gz
zsh-a295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3.tar.xz
zsh-a295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3.zip
allow _expand to expand braces; better detection of braces to complete in C (11973)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index af0c43f57..bc76ad4cd 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -1434,7 +1434,19 @@ get_comp_string(void)
 		    }
 		}
 	    } else if (p < curs) {
+		if (*p == Outbrace) {
+		    cant = 1;
+		    break;
+		}
 		if (*p == Inbrace) {
+		    char *tp = p;
+
+		    if (!skipparens(Inbrace, Outbrace, &tp)) {
+			i += tp - p - 1;
+			dp += tp - p - 1;
+			p = tp - 1;
+			continue;
+		    }
 		    if (bbeg) {
 			Brinfo new;
 			int len = bend - bbeg;
@@ -1470,6 +1482,18 @@ get_comp_string(void)
 		    hascom = 1;
 		}
 	    } else {
+		if (*p == Inbrace) {
+		    char *tp = p;
+
+		    if (!skipparens(Inbrace, Outbrace, &tp)) {
+			i += tp - p - 1;
+			dp += tp - p - 1;
+			p = tp - 1;
+			continue;
+		    }
+		    cant = 1;
+		    break;
+		}
 		if (p == curs) {
 		    if (bbeg) {
 			Brinfo new;
@@ -1501,7 +1525,7 @@ get_comp_string(void)
 		if (*p == Comma) {
 		    if (!bbeg)
 			bbeg = p;
-		    hascom = 1;
+		    hascom = 2;
 		} else if (*p == Outbrace) {
 		    Brinfo new;
 		    int len;