When inputting text outside the command line we don't want to use tab
for command completion. Add an option to control this.
Signed-off-by: Simon Glass <sjg@chromium.org>
}
break;
case '\t':
- if (IS_ENABLED(CONFIG_AUTO_COMPLETE)) {
+ if (IS_ENABLED(CONFIG_AUTO_COMPLETE) && cls->cmd_complete) {
int num2, col;
/* do not autocomplete when in the middle */
cls->prompt = prompt;
cls->buf = buf;
cls->history = true;
+ cls->cmd_complete = true;
if (init_len)
cread_add_str(buf, init_len, 1, &cls->num, &cls->eol_num, buf,
* @eol_num: Number of characters in the buffer
* @insert: true if in 'insert' mode
* @history: true if history should be accessible
+ * @cmd_complete: true if tab completion should be enabled
* @buf: Buffer containing line
* @prompt: Prompt for the line
*/
uint len;
bool insert;
bool history;
+ bool cmd_complete;
char *buf;
const char *prompt;
};