mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.1.2187: error for bad regexp even though regexp is not used
Problem: Error for bad regexp even though regexp is not used when writing a file. (Arseny Nasokin) Solution: Ignore regexp errors. (closes #5059)
This commit is contained in:
@@ -1976,6 +1976,8 @@ ExpandFromContext(
|
|||||||
flags |= EW_KEEPALL;
|
flags |= EW_KEEPALL;
|
||||||
if (options & WILD_SILENT)
|
if (options & WILD_SILENT)
|
||||||
flags |= EW_SILENT;
|
flags |= EW_SILENT;
|
||||||
|
if (options & WILD_NOERROR)
|
||||||
|
flags |= EW_NOERROR;
|
||||||
if (options & WILD_ALLLINKS)
|
if (options & WILD_ALLLINKS)
|
||||||
flags |= EW_ALLLINKS;
|
flags |= EW_ALLLINKS;
|
||||||
|
|
||||||
|
@@ -4211,7 +4211,8 @@ expand_filename(
|
|||||||
else /* n == 2 */
|
else /* n == 2 */
|
||||||
{
|
{
|
||||||
expand_T xpc;
|
expand_T xpc;
|
||||||
int options = WILD_LIST_NOTFOUND|WILD_ADD_SLASH;
|
int options = WILD_LIST_NOTFOUND
|
||||||
|
| WILD_NOERROR | WILD_ADD_SLASH;
|
||||||
|
|
||||||
ExpandInit(&xpc);
|
ExpandInit(&xpc);
|
||||||
xpc.xp_context = EXPAND_FILES;
|
xpc.xp_context = EXPAND_FILES;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
" Tests for the writefile() function.
|
" Tests for the writefile() function and some :write commands.
|
||||||
|
|
||||||
func Test_writefile()
|
func Test_writefile()
|
||||||
let f = tempname()
|
let f = tempname()
|
||||||
@@ -16,6 +16,11 @@ func Test_writefile()
|
|||||||
call delete(f)
|
call delete(f)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_writefile_ignore_regexp_error()
|
||||||
|
write Xt[z-a]est.txt
|
||||||
|
call delete('Xt[z-a]est.txt')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_writefile_fails_gently()
|
func Test_writefile_fails_gently()
|
||||||
call assert_fails('call writefile(["test"], "Xfile", [])', 'E730:')
|
call assert_fails('call writefile(["test"], "Xfile", [])', 'E730:')
|
||||||
call assert_false(filereadable("Xfile"))
|
call assert_false(filereadable("Xfile"))
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2187,
|
||||||
/**/
|
/**/
|
||||||
2186,
|
2186,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user