diff options
author | KillTheMule <github@pipsfrank.de> | 2017-07-03 09:36:43 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-07-08 17:51:42 +0200 |
commit | 619838f85da24d692221ba7cc310d6839ebbe2a5 (patch) | |
tree | d43dc6cece1acc6dddcbe53d5dda99a64cdfeba3 /src | |
parent | 0fb4d173f8faa7ec4736ceb3b4e89ada6f7d73e5 (diff) | |
download | rneovim-619838f85da24d692221ba7cc310d6839ebbe2a5.tar.gz rneovim-619838f85da24d692221ba7cc310d6839ebbe2a5.tar.bz2 rneovim-619838f85da24d692221ba7cc310d6839ebbe2a5.zip |
inccommand: improve performance #6949
During a preview, we can stop looking for matches after we got enough
lines for the preview buffer.
Because of this perf improvement, the 'redrawtime' test needs to be
slowed down in a different way: _long_ lines instead of just many lines.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 8dcb3ac449..b550e9a9c6 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3332,7 +3332,8 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout) // Check for a match on each line. linenr_T line2 = eap->line2; for (linenr_T lnum = eap->line1; - lnum <= line2 && !(got_quit || aborting()); + lnum <= line2 && !(got_quit || aborting()) + && (!preview || matched_lines.size <= (size_t)p_cwh); lnum++) { long nmatch = vim_regexec_multi(®match, curwin, curbuf, lnum, (colnr_T)0, NULL); |