diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-15 20:59:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-15 20:59:48 +0200 |
commit | 396659592fe039decc8c088694912067fe32a681 (patch) | |
tree | 507846d053925c86e7ff01c900f02bede7b62bb5 /src/ex_docmd.c | |
parent | 37b15568c26e669c333903a70422eacc09488f79 (diff) | |
download | vim-git-396659592fe039decc8c088694912067fe32a681.tar.gz |
patch 8.1.0288: quickfix code uses cmdidx too oftenv8.1.0288
Problem: Quickfix code uses cmdidx too often.
Solution: Add is_loclist_cmd(). (Yegappan Lakshmanan)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 169cb7a64..14ec21323 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -12529,6 +12529,20 @@ ex_folddo(exarg_T *eap) } #endif +#ifdef FEAT_QUICKFIX +/* + * Returns TRUE if the supplied Ex cmdidx is for a location list command + * instead of a quickfix command. + */ + int +is_loclist_cmd(int cmdidx) +{ + if (cmdidx < 0 || cmdidx > CMD_SIZE) + return FALSE; + return cmdnames[cmdidx].cmd_name[0] == 'l'; +} +#endif + # if defined(FEAT_TIMERS) || defined(PROTO) int get_pressedreturn(void) |