changeset 19701:9412cc889072 v8.2.0407

patch 8.2.0407: no early check if :find and :sfind have an argument Commit: https://github.com/vim/vim/commit/2d10cd478047df8ba144d4b0fcc46480993af57f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 19 14:37:30 2020 +0100 patch 8.2.0407: no early check if :find and :sfind have an argument Problem: No early check if :find and :sfind have an argument. Solution: Add EX_NEEDARG.
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Mar 2020 14:45:04 +0100
parents 94af390cac3f
children 7ec14b594de3
files src/ex_cmds.h src/testdir/test_find_complete.vim src/testdir/test_findfile.vim src/version.c
diffstat 4 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -584,7 +584,7 @@ EXCMD(CMD_filter,	"filter",	ex_wrongmodi
 	EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
 	ADDR_NONE),
 EXCMD(CMD_find,		"find",		ex_find,
-	EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
+	EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG,
 	ADDR_OTHER),
 EXCMD(CMD_finally,	"finally",	ex_finally,
 	EX_TRLBAR|EX_SBOXOK|EX_CMDWIN,
@@ -1334,7 +1334,7 @@ EXCMD(CMD_setlocal,	"setlocal",	ex_set,
 	EX_BANG|EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK,
 	ADDR_NONE),
 EXCMD(CMD_sfind,	"sfind",	ex_splitview,
-	EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
+	EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG,
 	ADDR_OTHER),
 EXCMD(CMD_sfirst,	"sfirst",	ex_rewind,
 	EX_EXTRA|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
--- a/src/testdir/test_find_complete.vim
+++ b/src/testdir/test_find_complete.vim
@@ -15,22 +15,22 @@ func Test_find_complete()
 
   new
   set path=
-  call assert_fails('call feedkeys(":find\t\n", "xt")', 'E345:')
+  call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
   close
 
   new
   set path=.
-  call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:')
+  call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
   close
 
   new
   set path=.,,
-  call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:')
+  call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
   close
 
   new
   set path=./**
-  call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:')
+  call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
   close
 
   " We shouldn't find any file till this point
--- a/src/testdir/test_findfile.vim
+++ b/src/testdir/test_findfile.vim
@@ -222,4 +222,8 @@ func Test_find_cmd()
   call CleanFiles()
   let &path = save_path
   close
+
+  call assert_fails('find', 'E471:')
+  call assert_fails('sfind', 'E471:')
+  call assert_fails('tabfind', 'E471:')
 endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    407,
+/**/
     406,
 /**/
     405,