diff src/quickfix.c @ 14307:df27d6270691 v8.1.0169

patch 8.1.0169: calling message_filtered() a bit too often commit https://github.com/vim/vim/commit/a9defadb8f03ecd03f3297305d5482ba380774dc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 8 18:20:24 2018 +0200 patch 8.1.0169: calling message_filtered() a bit too often Problem: Calling message_filtered() a bit too often. Solution: Only call message_filtered() when filtering is already false.
author Christian Brabandt <cb@256bit.org>
date Sun, 08 Jul 2018 18:30:06 +0200
parents 3c80092eb211
children 19d99d9e670c
line wrap: on
line diff
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3139,18 +3139,21 @@ qf_list(exarg_T *eap)
 		    sprintf((char *)IObuff, "%2d", i);
 		else
 		    vim_snprintf((char *)IObuff, IOSIZE, "%2d %s",
-								i, (char *)fname);
+							     i, (char *)fname);
 	    }
 
 	    // Support for filtering entries using :filter /pat/ clist
-	    filter_entry = 1;
+	    // Match against the module name, file name, search pattern and
+	    // text of the entry.
+	    filter_entry = TRUE;
 	    if (qfp->qf_module != NULL && *qfp->qf_module != NUL)
 		filter_entry &= message_filtered(qfp->qf_module);
-	    if (fname != NULL)
+	    if (filter_entry && fname != NULL)
 		filter_entry &= message_filtered(fname);
-	    if (qfp->qf_pattern != NULL)
+	    if (filter_entry && qfp->qf_pattern != NULL)
 		filter_entry &= message_filtered(qfp->qf_pattern);
-	    filter_entry &= message_filtered(qfp->qf_text);
+	    if (filter_entry)
+		filter_entry &= message_filtered(qfp->qf_text);
 	    if (filter_entry)
 		goto next_entry;