diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-01-03 22:28:49 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-01-03 22:29:11 +0000 |
| commit | 540d82c452509f8d6d157bfd174e6581eaf20abf (patch) | |
| tree | 0b9392834e2262e4e3d1cc12e05e59405ccc24ec /src/completion.cc | |
| parent | 3017531699ba988150e2771e6a0ea3635b3dc15f (diff) | |
shell_completion use command completion after | and &&
Fixes #21
Diffstat (limited to 'src/completion.cc')
| -rw-r--r-- | src/completion.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/completion.cc b/src/completion.cc index 51132d93..a3e99ce4 100644 --- a/src/completion.cc +++ b/src/completion.cc @@ -15,7 +15,8 @@ Completions shell_complete(const Context& context, CompletionFlags flags, const ByteCount len = prefix.length(); 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])) ++pos; word_start = pos; |
