redraw_cmdline = TRUE;
}
+/*
+ * Guess that the pattern matches everything. Only finds specific cases, such
+ * as a trailing \|, which can happen while typing a pattern.
+ */
+ static int
+empty_pattern(char_u *p)
+{
+ int n = STRLEN(p);
+
+ /* remove trailing \v and the like */
+ while (n >= 2 && p[n - 2] == '\\'
+ && vim_strchr((char_u *)"mMvVcCZ", p[n - 1]) != NULL)
+ n -= 2;
+ return n == 0 || (n >= 2 && p[n - 2] == '\\' && p[n - 1] == '|');
+}
+
/*
* getcmdline() - accept a command line starting with firstc.
*
else
end_pos = curwin->w_cursor; /* shutup gcc 4 */
+ /* Disable 'hlsearch' highlighting if the pattern matches
+ * everything. Avoids a flash when typing "foo\|". */
+ if (empty_pattern(ccline.cmdbuff))
+ SET_NO_HLSEARCH(TRUE);
+
validate_cursor();
/* May redraw the status line to show the cursor position. */
if (p_ru && curwin->w_status_height > 0)