From 09f1818beddfad715e3a0fedfb523fc78c295100 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 25 Sep 2013 10:07:02 +0400 Subject: [PATCH] Ticket #3018: broken directory completion. In the command line, the subdirectory completion in current directory isn't performed if stub isn't starting with './'. Signed-off-by: Andrew Borodin --- lib/widget/input_complete.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/widget/input_complete.c b/lib/widget/input_complete.c index e822f7966..be2759d59 100644 --- a/lib/widget/input_complete.c +++ b/lib/widget/input_complete.c @@ -1350,12 +1350,19 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags) matches = completion_matches (state.word, username_completion_function, state.flags); } - /* And finally if this word is in a command position, then + /* If this word is in a command position, then complete over possible command names, including aliases, functions, and command names. */ if (matches == NULL) matches = try_complete_all_possible (&state, text, lc_start); + /* And finally if nothing found, try complete directory name */ + if (matches == NULL) + { + state.in_command_position = 0; + matches = try_complete_all_possible (&state, text, lc_start); + } + g_free (state.word); if (matches != NULL &&