File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,22 @@ abandon_cmdline(void)
172172 redraw_cmdline = TRUE;
173173}
174174
175+ /*
176+ * Guess that the pattern matches everything. Only finds specific cases, such
177+ * as a trailing \|, which can happen while typing a pattern.
178+ */
179+ static int
180+ empty_pattern (char_u * p )
181+ {
182+ int n = STRLEN (p );
183+
184+ /* remove trailing \v and the like */
185+ while (n >= 2 && p [n - 2 ] == '\\'
186+ && vim_strchr ((char_u * )"mMvVcCZ" , p [n - 1 ]) != NULL )
187+ n -= 2 ;
188+ return n == 0 || (n >= 2 && p [n - 2 ] == '\\' && p [n - 1 ] == '|' );
189+ }
190+
175191/*
176192 * getcmdline() - accept a command line starting with firstc.
177193 *
@@ -2023,6 +2039,11 @@ getcmdline(
20232039 else
20242040 end_pos = curwin -> w_cursor ; /* shutup gcc 4 */
20252041
2042+ /* Disable 'hlsearch' highlighting if the pattern matches
2043+ * everything. Avoids a flash when typing "foo\|". */
2044+ if (empty_pattern (ccline .cmdbuff ))
2045+ SET_NO_HLSEARCH (TRUE);
2046+
20262047 validate_cursor ();
20272048 /* May redraw the status line to show the cursor position. */
20282049 if (p_ru && curwin -> w_status_height > 0 )
Original file line number Diff line number Diff line change @@ -771,6 +771,8 @@ static char *(features[]) =
771771
772772static int included_patches [] =
773773{ /* Add new patch number below this line */
774+ /**/
775+ 1393 ,
774776/**/
775777 1392 ,
776778/**/
You can’t perform that action at this time.
0 commit comments