diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-06-21 22:44:33 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-06-23 18:17:09 -0400 |
commit | ff244a1309482e818c6731038f0232fae613431c (patch) | |
tree | e082b45b6aa474973da7faf780555bc059ee5711 /src/nvim/quickfix.c | |
parent | f99e314da06fa50fcc2a6a2bf0833ea365f121a9 (diff) | |
download | rneovim-ff244a1309482e818c6731038f0232fae613431c.tar.gz rneovim-ff244a1309482e818c6731038f0232fae613431c.tar.bz2 rneovim-ff244a1309482e818c6731038f0232fae613431c.zip |
vim-patch:8.1.0165: :clist output can be very long
Problem: :clist output can be very long.
Solution: Support filtering :clist entries. (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/4cde86c2ef885e82fff3d925dee9fb5671c025cf
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 3c744310b3..fb753609bd 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2528,9 +2528,9 @@ void qf_list(exarg_T *eap) qfp = qi->qf_lists[qi->qf_curlist].qf_start; for (i = 1; !got_int && i <= qi->qf_lists[qi->qf_curlist].qf_count; ) { if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2) { - msg_putchar('\n'); - if (got_int) + if (got_int) { break; + } fname = NULL; if (qfp->qf_module != NULL && *qfp->qf_module != NUL) { @@ -2549,6 +2549,23 @@ void qf_list(exarg_T *eap) vim_snprintf((char *)IObuff, IOSIZE, "%2d %s", i, (char *)fname); } } + + // Support for filtering entries using :filter /pat/ clist + int filter_entry = 1; + if (qfp->qf_module != NULL && *qfp->qf_module != NUL) { + filter_entry &= message_filtered(qfp->qf_module); + } + if (fname != NULL) { + filter_entry &= message_filtered(fname); + } + if (qfp->qf_pattern != NULL) { + filter_entry &= message_filtered(qfp->qf_pattern); + } + filter_entry &= message_filtered(qfp->qf_text); + if (filter_entry) { + goto next_entry; + } + msg_putchar('\n'); msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index ? HL_ATTR(HLF_QFL) : HL_ATTR(HLF_D)); if (qfp->qf_lnum == 0) { @@ -2579,6 +2596,7 @@ void qf_list(exarg_T *eap) ui_flush(); /* show one line at a time */ } +next_entry: qfp = qfp->qf_next; if (qfp == NULL) { break; |