From db1c9b625cd200a9ed2fc8dc842eb76a329eb144 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 22 Apr 2018 19:46:27 +0300 Subject: search: Fix PVS/V547: condition already checked in surrounding if --- src/nvim/search.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/search.c b/src/nvim/search.c index 102a42fe15..3b726b6d08 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -3944,15 +3944,15 @@ current_search ( if (VIsual_active) { orig_pos = pos = curwin->w_cursor; - /* make sure, searching further will extend the match */ - if (VIsual_active) { - if (forward) - incl(&pos); - else - decl(&pos); + // Searching further will extend the match. + if (forward) { + incl(&pos); + } else { + decl(&pos); } - } else + } else { orig_pos = pos = curwin->w_cursor; + } /* Is the pattern is zero-width? */ int one_char = is_one_char(spats[last_idx].pat, true); -- cgit