mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
Merge pull request #19523 from ii14/vim-9.0.0085
vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
This commit is contained in:
commit
289256337a
@ -2725,6 +2725,12 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum
|
|||||||
// Assume success now
|
// Assume success now
|
||||||
retval = OK;
|
retval = OK;
|
||||||
|
|
||||||
|
// If the file name was changed, reset the not-edit flag so that ":write"
|
||||||
|
// works.
|
||||||
|
if (!other_file) {
|
||||||
|
curbuf->b_flags &= ~BF_NOTEDITED;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if we are editing the w_arg_idx file in the argument list.
|
* Check if we are editing the w_arg_idx file in the argument list.
|
||||||
*/
|
*/
|
||||||
|
@ -696,5 +696,21 @@ func Test_using_zero_in_range()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test :write after changing name with :file and loading it with :edit
|
||||||
|
func Test_write_after_rename()
|
||||||
|
call writefile(['text'], 'Xfile')
|
||||||
|
|
||||||
|
enew
|
||||||
|
file Xfile
|
||||||
|
call assert_fails('write', 'E13: File exists (add ! to override)')
|
||||||
|
|
||||||
|
" works OK after ":edit"
|
||||||
|
edit
|
||||||
|
write
|
||||||
|
|
||||||
|
call delete('Xfile')
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user