summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/comp.h6
-rw-r--r--Src/Zle/complete.c8
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c761eb2c2..f2ec7cc25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-11-03  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 39804: Src/Zle/comp.h, Src/Zle/complete.c: internal: Document
+	matchspec flags.
+
 	* 39803: Src/Zle/complete.c: internal: Document bin_compadd().
 
 	* 39802: Src/Zle/compcore.c, Src/Zle/complete.c: internal:
diff --git a/Src/Zle/comp.h b/Src/Zle/comp.h
index dfac35cfb..14af6173c 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 484754bee..7980518b7 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;