summaryrefslogtreecommitdiffstats
path: root/enter.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-09-12 19:41:02 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-09-12 19:41:02 +0000
commit3d99b5254b7a81d4ce32663c53291ab66e406212 (patch)
tree8ffcc4b5256752e3f90cae65fbfe099ff4474629 /enter.c
parentbc42769b83cc62cd98a81792a6d6068ce14ce649 (diff)
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 <VikasA@att.com>)
Diffstat (limited to 'enter.c')
-rw-r--r--enter.c18
1 files changed, 13 insertions, 5 deletions
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;