]> granicus.if.org Git - vim/commitdiff
patch 8.2.3813: confusing error when using :cc without error list v8.2.3813
authorBram Moolenaar <Bram@vim.org>
Wed, 15 Dec 2021 12:28:22 +0000 (12:28 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 15 Dec 2021 12:28:22 +0000 (12:28 +0000)
Problem:    confusing error when using :cc without error list. (Gary Johnson)
Solution:   Give the "no errors" error.

src/ex_docmd.c
src/testdir/test_quickfix.vim
src/version.c

index aff4c95f93116fed1da308e9ec74c820f67c899a..c06a508abfa0d7b2708c9dd55c8a745fa2a1a04e 100644 (file)
@@ -4633,7 +4633,11 @@ invalid_range(exarg_T *eap)
 #ifdef FEAT_QUICKFIX
                // No error for value that is too big, will use the last entry.
                if (eap->line2 <= 0)
+               {
+                   if (eap->addr_count == 0)
+                       return _(e_no_errors);
                    return _(e_invalid_range);
+               }
 #endif
                break;
            case ADDR_QUICKFIX_VALID:
index 283e943794fd337b2afac5737ed11f1d2375c30c..895c52acaffd164b3e50f512df1a671bb7b37f2d 100644 (file)
@@ -86,6 +86,12 @@ func s:setup_commands(cchar)
   endif
 endfunc
 
+" This must be run before any error lists are created.
+func Test_AA_cc_no_errors()
+  call assert_fails('cc', 'E42:')
+  call assert_fails('ll', 'E42:')
+endfunc
+
 " Tests for the :clist and :llist commands
 func XlistTests(cchar)
   call s:setup_commands(a:cchar)
index 67f1e37e9d8a9ad60a5e59d3b9026eba3a5334e7..b8f9d9a7900643fc84fa5468c8fe9eaff8af7b43 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3813,
 /**/
     3812,
 /**/