diff options
author | ZyX <kp-pav@yandex.ru> | 2018-04-22 19:44:56 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2018-04-22 19:44:56 +0300 |
commit | b144a77f380a8ec5d7579ee888bf051617cf3dfb (patch) | |
tree | 7ed05485b6c9c85f6f6f1aed60225e54818f0862 /src | |
parent | 3c7cc03f345ace2cdeeb71163ad5ed2c10c59a1f (diff) | |
download | rneovim-b144a77f380a8ec5d7579ee888bf051617cf3dfb.tar.gz rneovim-b144a77f380a8ec5d7579ee888bf051617cf3dfb.tar.bz2 rneovim-b144a77f380a8ec5d7579ee888bf051617cf3dfb.zip |
search: Fix PVS/V547: checking variable right after assigning it
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/search.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index 1943e2ca43..102a42fe15 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4017,23 +4017,22 @@ current_search ( VIsual = start_pos; curwin->w_cursor = pos; - VIsual_active = TRUE; + VIsual_active = true; VIsual_mode = 'v'; - if (VIsual_active) { - redraw_curbuf_later(INVERTED); /* update the inversion */ - if (*p_sel == 'e') { - /* Correction for exclusive selection depends on the direction. */ - if (forward && ltoreq(VIsual, curwin->w_cursor)) - inc_cursor(); - else if (!forward && ltoreq(curwin->w_cursor, VIsual)) - inc(&VIsual); + redraw_curbuf_later(INVERTED); // Update the inversion. + if (*p_sel == 'e') { + // Correction for exclusive selection depends on the direction. + if (forward && ltoreq(VIsual, curwin->w_cursor)) { + inc_cursor(); + } else if (!forward && ltoreq(curwin->w_cursor, VIsual)) { + inc(&VIsual); } - } - if (fdo_flags & FDO_SEARCH && KeyTyped) + if (fdo_flags & FDO_SEARCH && KeyTyped) { foldOpenCursor(); + } may_start_select('c'); setmouse(); |