diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2017-09-24 14:17:59 +0200 |
---|---|---|
committer | KillTheMule <KillTheMule@users.noreply.github.com> | 2017-10-29 18:11:32 +0100 |
commit | 7b4baad6747a1f812bdf62e5c8c7b59a6977ce44 (patch) | |
tree | 53d4259ba1973fb122b2c0a3fa428e4d18915dfc | |
parent | 369ac900f97059de21d946aa460d4ef2b6899b3e (diff) | |
download | rneovim-7b4baad6747a1f812bdf62e5c8c7b59a6977ce44.tar.gz rneovim-7b4baad6747a1f812bdf62e5c8c7b59a6977ce44.tar.bz2 rneovim-7b4baad6747a1f812bdf62e5c8c7b59a6977ce44.zip |
Remove superflous parameter from show_sub
-rw-r--r-- | src/nvim/ex_cmds.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index ab4c52a635..85e65f32c2 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4064,7 +4064,7 @@ skip: pre_hl_id = syn_check_group((char_u *)"Substitute", 13); } curbuf->b_changed = save_b_changed; // preserve 'modified' during preview - preview_buf = show_sub(eap, old_cursor, &preview_lines, true, + preview_buf = show_sub(eap, old_cursor, &preview_lines, pre_hl_id, pre_src_id); if (subsize > 0) { bufhl_clear_line_range(orig_buf, pre_src_id, eap->line1, @@ -6077,8 +6077,7 @@ void set_context_in_sign_cmd(expand_T *xp, char_u *arg) /// Shows the effects of the :substitute command being typed ('inccommand'). /// If inccommand=split, shows a preview window and later restores the layout. static buf_T *show_sub(exarg_T *eap, pos_T old_cusr, - PreviewLines *preview_lines, bool show_hl, int hl_id, - int src_id) + PreviewLines *preview_lines, int hl_id, int src_id) FUNC_ATTR_NONNULL_ALL { static handle_T bufnr = 0; // special buffer, re-used on each visit @@ -6198,15 +6197,11 @@ static buf_T *show_sub(exarg_T *eap, pos_T old_cusr, } linenr_origbuf = match.end.lnum; - if (show_hl) { - bufhl_add_hl_pos_offset(preview_buf, src_id, hl_id, p_start, - p_end, col_width); - } - } - if (show_hl) { - bufhl_add_hl_pos_offset(orig_buf, src_id, hl_id, match.start, - match.end, 0); + bufhl_add_hl_pos_offset(preview_buf, src_id, hl_id, p_start, + p_end, col_width); } + bufhl_add_hl_pos_offset(orig_buf, src_id, hl_id, match.start, + match.end, 0); } xfree(str); |