diff src/search.c @ 15758:675dd5d7afb3 v8.1.0886

patch 8.1.0886: compiler warning for NULL pointer and condition always true commit https://github.com/vim/vim/commit/b7633611611eeb5f14f8fd598afa687964e23f23 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 10 21:48:25 2019 +0100 patch 8.1.0886: compiler warning for NULL pointer and condition always true Problem: Compiler warning for adding to NULL pointer and a condition that is always true. Solution: Check for NULL pointer before adding. Remove useless "if". (Friedirch, closes #3913)
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 Feb 2019 22:00:07 +0100
parents ad8b2c109b22
children a6ca8cf07a98
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -4732,18 +4732,14 @@ current_search(
     VIsual_active = TRUE;
     VIsual_mode = 'v';
 
-    if (VIsual_active)
+    redraw_curbuf_later(INVERTED);	/* update the inversion */
+    if (*p_sel == 'e')
     {
-	redraw_curbuf_later(INVERTED);	/* update the inversion */
-	if (*p_sel == 'e')
-	{
-	    /* Correction for exclusive selection depends on the direction. */
-	    if (forward && LTOREQ_POS(VIsual, curwin->w_cursor))
-		inc_cursor();
-	    else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual))
-		inc(&VIsual);
-	}
-
+	/* Correction for exclusive selection depends on the direction. */
+	if (forward && LTOREQ_POS(VIsual, curwin->w_cursor))
+	    inc_cursor();
+	else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual))
+	    inc(&VIsual);
     }
 
 #ifdef FEAT_FOLDING