diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/client.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/client/client.c b/client/client.c index 6e465bce..6a217c7f 100644 --- a/client/client.c +++ b/client/client.c @@ -168,22 +168,28 @@ input_complete(int arg UNUSED, int key UNUSED) static int input_help(int arg, int key UNUSED) { - int i, in_string, in_path; + int i, in_string, in_bracket; if (arg != 1) return rl_insert(arg, '?'); - in_string = in_path = 0; + in_string = in_bracket = 0; for (i = 0; i < rl_point; i++) { + if (rl_line_buffer[i] == '"') in_string = ! in_string; - else if ((rl_line_buffer[i] == '|') && (! in_string)) - in_path = ! in_path; + else if (! in_string) + { + if (rl_line_buffer[i] == '[') + in_bracket++; + else if (rl_line_buffer[i] == ']') + in_bracket--; + } } /* `?' inside string or path -> insert */ - if (in_string || in_path) + if (in_string || in_bracket) return rl_insert(1, '?'); rl_begin_undo_group(); /* HACK: We want to display `?' at point position */ |