diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2020-10-12 18:01:43 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-04-05 20:21:43 +0200 |
commit | 54cec455ccdae2a63144809f947dad5cf510b7c7 (patch) | |
tree | a5a8ff387e11ae1dd74b84496cf50f44f4fe4c91 /src | |
parent | 969d600f2a107507c60e4ac3f3a8c03210662f96 (diff) | |
download | rneovim-54cec455ccdae2a63144809f947dad5cf510b7c7.tar.gz rneovim-54cec455ccdae2a63144809f947dad5cf510b7c7.tar.bz2 rneovim-54cec455ccdae2a63144809f947dad5cf510b7c7.zip |
fix(ui): inccomand performance degradation
It was broken since the introduction of the macro.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 65cb544efd..5d5b342c35 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4313,18 +4313,22 @@ skip: #define PUSH_PREVIEW_LINES() \ do { \ - linenr_T match_lines = current_match.end.lnum \ - - current_match.start.lnum +1; \ - if (preview_lines.subresults.size > 0) { \ - linenr_T last = kv_last(preview_lines.subresults).end.lnum; \ - if (last == current_match.start.lnum) { \ - preview_lines.lines_needed += match_lines - 1; \ + if (preview) { \ + linenr_T match_lines = current_match.end.lnum \ + - current_match.start.lnum +1; \ + if (preview_lines.subresults.size > 0) { \ + linenr_T last = kv_last(preview_lines.subresults).end.lnum; \ + if (last == current_match.start.lnum) { \ + preview_lines.lines_needed += match_lines - 1; \ + } else { \ + preview_lines.lines_needed += match_lines; \ + } \ + } else { \ + preview_lines.lines_needed += match_lines; \ } \ - } else { \ - preview_lines.lines_needed += match_lines; \ + kv_push(preview_lines.subresults, current_match); \ } \ - kv_push(preview_lines.subresults, current_match); \ - } while (0) + } while (0) // Push the match to preview_lines. PUSH_PREVIEW_LINES(); |