vim-patch:8.1.0288: quickfix code uses cmdidx too often

Problem:    Quickfix code uses cmdidx too often.
Solution:   Add is_loclist_cmd(). (Yegappan Lakshmanan)
396659592f
This commit is contained in:
Jan Edmund Lazo
2019-10-13 19:19:32 -04:00
parent 6dceaf3361
commit 5e02bd071e
2 changed files with 76 additions and 57 deletions

View File

@@ -10139,6 +10139,17 @@ static void ex_folddo(exarg_T *eap)
ml_clearmarked(); // clear rest of the marks
}
// Returns true if the supplied Ex cmdidx is for a location list command
// instead of a quickfix command.
bool is_loclist_cmd(int cmdidx)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
if (cmdidx < 0 || cmdidx > CMD_SIZE) {
return false;
}
return cmdnames[cmdidx].cmd_name[0] == 'l';
}
bool get_pressedreturn(void)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{