Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 3/4] internal: Document matchspec flags.



---
 Src/Zle/comp.h     | 6 ++++++
 Src/Zle/complete.c | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Src/Zle/comp.h b/Src/Zle/comp.h
index dfac35c..14af617 100644
--- a/Src/Zle/comp.h
+++ b/Src/Zle/comp.h
@@ -160,9 +160,15 @@ struct cmatcher {
     int ralen;			/* length of right anchor */
 };
 
+/* Flags for cmatcher::flags */
+/* Upon match, insert the string from the line rather than the string
+ * from the trial completion ("word"). */
 #define CMF_LINE  1
+/* Match with an anchor on the left. */
 #define CMF_LEFT  2
+/* Match with an anchor on the right. */
 #define CMF_RIGHT 4
+/* ... */
 #define CMF_INTER 8
 
 /*
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 484754b..7980518 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -249,14 +249,14 @@ parse_cmatcher(char *name, char *s)
 	if (!*s) break;
 
 	switch (*s) {
-	case 'b': fl2 = CMF_INTER;
+	case 'b': fl2 = CMF_INTER; /* FALLTHROUGH */
 	case 'l': fl = CMF_LEFT; break;
-	case 'e': fl2 = CMF_INTER;
+	case 'e': fl2 = CMF_INTER; /* FALLTHROUGH */
 	case 'r': fl = CMF_RIGHT; break;
 	case 'm': fl = 0; break;
-	case 'B': fl2 = CMF_INTER;
+	case 'B': fl2 = CMF_INTER; /* FALLTHROUGH */
 	case 'L': fl = CMF_LEFT | CMF_LINE; break;
-	case 'E': fl2 = CMF_INTER;
+	case 'E': fl2 = CMF_INTER; /* FALLTHROUGH */
 	case 'R': fl = CMF_RIGHT | CMF_LINE; break;
 	case 'M': fl = CMF_LINE; break;
 	case 'x': break;



Messages sorted by: Reverse Date, Date, Thread, Author