mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
Support of disable of shell variables substitution in autocompletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ec476d0b88
commit
bff2736906
@ -875,7 +875,22 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
|
|||||||
if (flags & INPUT_COMPLETE_COMMANDS)
|
if (flags & INPUT_COMPLETE_COMMANDS)
|
||||||
p = strrchr (word, '`');
|
p = strrchr (word, '`');
|
||||||
if (flags & (INPUT_COMPLETE_COMMANDS | INPUT_COMPLETE_VARIABLES))
|
if (flags & (INPUT_COMPLETE_COMMANDS | INPUT_COMPLETE_VARIABLES))
|
||||||
|
{
|
||||||
q = strrchr (word, '$');
|
q = strrchr (word, '$');
|
||||||
|
|
||||||
|
/* don't substitute variable in \$ case */
|
||||||
|
if (q != NULL && q != word && q[-1] == '\\')
|
||||||
|
{
|
||||||
|
size_t qlen;
|
||||||
|
|
||||||
|
qlen = strlen (q);
|
||||||
|
/* drop '\\' */
|
||||||
|
memmove (q - 1, q, qlen + 1);
|
||||||
|
/* adjust flags */
|
||||||
|
flags &= ~INPUT_COMPLETE_VARIABLES;
|
||||||
|
q = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (flags & INPUT_COMPLETE_HOSTNAMES)
|
if (flags & INPUT_COMPLETE_HOSTNAMES)
|
||||||
r = strrchr (word, '@');
|
r = strrchr (word, '@');
|
||||||
if (q && q[1] == '(' && (flags & INPUT_COMPLETE_COMMANDS))
|
if (q && q[1] == '(' && (flags & INPUT_COMPLETE_COMMANDS))
|
||||||
|
Loading…
Reference in New Issue
Block a user