patch 9.1.1544: :retab cannot be limited to indentation only
Problem: :retab cannot be limited to indentation only
Solution: add the optional -indentonly parameter
(Hirohito Higashi)
closes: #17730
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
e85a66a4d4
commit
836e54f5de
@ -2622,6 +2622,11 @@ set_context_by_cmdname(
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_retab:
|
||||
xp->xp_context = EXPAND_RETAB;
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_messages:
|
||||
xp->xp_context = EXPAND_MESSAGES;
|
||||
xp->xp_pattern = arg;
|
||||
@ -3204,6 +3209,18 @@ get_scriptnames_arg(expand_T *xp UNUSED, int idx)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||
* ":retab {-indentonly}" option.
|
||||
*/
|
||||
static char_u *
|
||||
get_retab_arg(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx == 0)
|
||||
return (char_u *)"-indentonly";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||
* ":messages {clear}" command.
|
||||
@ -3294,6 +3311,7 @@ ExpandOther(
|
||||
{EXPAND_BREAKPOINT, get_breakadd_arg, TRUE, TRUE},
|
||||
{EXPAND_SCRIPTNAMES, get_scriptnames_arg, TRUE, FALSE},
|
||||
#endif
|
||||
{EXPAND_RETAB, get_retab_arg, TRUE, TRUE},
|
||||
};
|
||||
int i;
|
||||
int ret = FAIL;
|
||||
|
||||
Reference in New Issue
Block a user