]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0767: A condition is always true in ex_getln.c v9.1.0767
authorzeertzjq <zeertzjq@outlook.com>
Tue, 8 Oct 2024 19:04:19 +0000 (21:04 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 8 Oct 2024 19:04:19 +0000 (21:04 +0200)
Problem:  A cmdlen == 0 condition is always true as ccline.cmdlen == 0
          was already checked above (after v9.1.0766).
Solution: Remove the condition and the variable.
          (zeertzjq)

closes: #15830

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_getln.c
src/testdir/test_mapping.vim
src/version.c

index da2a8c7b775ff7b63fe057c0d543bfb23f4522a5..980faf8566344b1272fb0c9cbc26afecdc6ff2e3 100644 (file)
@@ -1092,10 +1092,6 @@ cmdline_erase_chars(
     else if (ccline.cmdlen == 0 && c != Ctrl_W
            && ccline.cmdprompt == NULL && indent == 0)
     {
-#ifdef FEAT_SEARCH_EXTRA
-       int cmdlen;
-#endif
-
        // In ex and debug mode it doesn't make sense to return.
        if (exmode_active
 #ifdef FEAT_EVAL
@@ -1104,9 +1100,6 @@ cmdline_erase_chars(
           )
            return CMDLINE_NOT_CHANGED;
 
-#ifdef FEAT_SEARCH_EXTRA
-       cmdlen = ccline.cmdlen;
-#endif
        dealloc_cmdbuff();      // no commandline to return
 
        if (!cmd_silent)
@@ -1120,8 +1113,7 @@ cmdline_erase_chars(
            msg_putchar(' ');           // delete ':'
        }
 #ifdef FEAT_SEARCH_EXTRA
-       if (cmdlen == 0)
-           isp->search_start = isp->save_cursor;
+       isp->search_start = isp->save_cursor;
 #endif
        redraw_cmdline = TRUE;
        return GOTO_NORMAL_MODE;
index 122793c4da132c9502738a51ac4d327337a188be..c3525315fe2233e87429b4887cbd55cda0c9b046 100644 (file)
@@ -89,7 +89,7 @@ func Test_abclear_buffer()
         \        .. "!  foo           foobar", execute('abbrev'))
 
   abclear
-   call assert_equal("\n\nNo abbreviation found", execute('abbrev'))
+  call assert_equal("\n\nNo abbreviation found", execute('abbrev'))
 
   %bwipe
 endfunc
index f09a60f3af3748bb8aa51101f41b9486dc59f020..854865f6b0dd5b58a9da92542421eeb9be8f096d 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    767,
 /**/
     766,
 /**/