From 3d99b5254b7a81d4ce32663c53291ab66e406212 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Sat, 12 Sep 1998 19:41:02 +0000 Subject: When entering a 'set' command on the command-line, pressing TAB after string_var= will insert the current value of that variable. Note that this works only for variables of type 'string'. Also fixes the following buglets in command-completion: 1. doesnt work if you started the command-line with whitespace 2. Seems to think that 'Set', 'ReSeT', etc are valid commands (since it checks for 'strcasecmp' instead of 'strcmp' when completing the variable names Also fixes the following buglets in command-completion: (From: Vikas Agnihotri ) --- enter.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'enter.c') diff --git a/enter.c b/enter.c index 0d0a558b..6887595e 100644 --- a/enter.c +++ b/enter.c @@ -65,14 +65,16 @@ int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x, char tempbuf[_POSIX_PATH_MAX] = ""; history_class_t hclass; - if(flags & (M_FILE | M_EFILE)) + if (flags & (M_FILE | M_EFILE)) hclass = HC_FILE; - else if(flags & M_CMD) + else if (flags & M_CMD) hclass = HC_CMD; - else if(flags & M_ALIAS) + else if (flags & M_ALIAS) hclass = HC_ALIAS; - else if(flags & M_COMMAND) + else if (flags & M_COMMAND) hclass = HC_COMMAND; + else if (flags & M_PATTERN) + hclass = HC_PATTERN; else hclass = HC_OTHER; @@ -347,7 +349,13 @@ int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x, else if (flags & M_COMMAND) { buf[curpos] = 0; - if (mutt_command_complete ((char *) buf, buflen, curpos)) + if (buf[lastchar - 1] == '=' && + mutt_string_var_complete ((char *) buf, buflen, curpos)) + { + redraw = M_REDRAW_INIT; + continue; + } + else if (mutt_command_complete ((char *) buf, buflen, curpos)) { redraw = M_REDRAW_INIT; continue; -- cgit v1.2.3