Patch 8.2.3453

22 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 22, 2021, 8:20:20 AMSep 22
to vim...@googlegroups.com

Patch 8.2.3453
Problem: Autocmd not executed when editing a directory ending in a path
separator inside try block.
Solution: Return NOTDONE instead of FAIL. (closes #8885)
Files: src/fileio.c, src/testdir/test_autocmd.vim


*** ../vim-8.2.3452/src/fileio.c 2021-07-29 21:23:46.829817787 +0200
--- src/fileio.c 2021-09-22 14:13:00.953953596 +0200
***************
*** 338,344 ****
filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
msg_end();
msg_scroll = msg_save;
! return FAIL;
}
}

--- 338,344 ----
filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
msg_end();
msg_scroll = msg_save;
! return NOTDONE;
}
}

*** ../vim-8.2.3452/src/testdir/test_autocmd.vim 2021-08-05 20:39:59.354053658 +0200
--- src/testdir/test_autocmd.vim 2021-09-22 14:12:35.922015976 +0200
***************
*** 2346,2351 ****
--- 2346,2364 ----
au! throwing
endfunc

+ func Test_autocmd_in_try_block()
+ call mkdir('Xdir')
+ au BufEnter * let g:fname = expand('%')
+ try
+ edit Xdir/
+ endtry
+ call assert_match('Xdir', g:fname)
+
+ unlet g:fname
+ au! BufEnter
+ call delete('Xdir', 'rf')
+ endfunc
+
func Test_autocmd_SafeState()
CheckRunVimInTerminal

*** ../vim-8.2.3452/src/version.c 2021-09-21 19:36:57.587801535 +0200
--- src/version.c 2021-09-22 14:06:03.094839250 +0200
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3453,
/**/

--
There is a difference between "should work" and "does work",
it's called testing.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages