shell_completion use command completion after | and &&

Fixes #21
This commit is contained in:
Maxime Coste 2014-01-03 22:28:49 +00:00
parent 3017531699
commit 540d82c452

View File

@ -15,7 +15,8 @@ Completions shell_complete(const Context& context, CompletionFlags flags,
const ByteCount len = prefix.length(); const ByteCount len = prefix.length();
for (ByteCount pos = 0; pos < cursor_pos;) for (ByteCount pos = 0; pos < cursor_pos;)
{ {
command = (pos == 0 or prefix[pos-1] == ';'); command = (pos == 0 or prefix[pos-1] == ';' or prefix[pos-1] == '|' or
(pos > 1 and prefix[pos-1] == '&' and prefix[pos-2] == '&'));
while (pos != len and is_blank(prefix[pos])) while (pos != len and is_blank(prefix[pos]))
++pos; ++pos;
word_start = pos; word_start = pos;