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

Re: Completion of prefix redirections is -command- instead of -redirect-



On Aug 27,  2:16am, Mikael Magnusson wrote:
}
} commit 249999cfb485914fe6f8630b1f4079e1227a5097
} Author: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
} Date:   Sun Aug 9 18:40:54 2015 +0100
} 
}     36025: Fix completion aftoer "foo=bar; setopt ".
} 
}     Done by catching a case that doesn't seem to be handled otherwise,
}     so there's some hope it doesn't screw up too much.
} 
} With the above commit reverted, < <tab> completes files again, but so
} does ; <tab>.

Does this do it?


diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index b87b99b..cb17bde 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -1184,11 +1184,12 @@ get_comp_string(void)
 	 * considering a new command.  Consequently, although this looks
 	 * relatively harmless by itself, it's probably incomplete.
 	 */
-	lincmd = (incmdpos && !ins && !incond) ||
-	    (oins == 2 && wordpos == 2) ||
-	    (ins == 3 && wordpos == 1) ||
-	    (cmdtok == NULLTOK && !incond);
 	linredir = (inredir && !ins);
+	lincmd = !linredir &&
+	    ((incmdpos && !ins && !incond) ||
+	     (oins == 2 && wordpos == 2) ||
+	     (ins == 3 && wordpos == 1) ||
+	     (cmdtok == NULLTOK && !incond));
 	oins = ins;
 	/* Get the next token. */
 	if (linarr)



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