feat: ":wall ++p" creates parent dirs for each buf #36121

`:wall ++p` will create parent directories if they do not exist, for
each modified buffer
This commit is contained in:
Rob Pilling
2025-10-11 16:27:58 +01:00
committed by GitHub
parent f0b9232ad8
commit ce27423132
5 changed files with 39 additions and 9 deletions

View File

@@ -23,6 +23,9 @@ describe(':write', function()
os.remove('test_fifo')
os.remove('test/write/p_opt.txt')
os.remove('test/write')
os.remove('test/write2/p_opt.txt')
os.remove('test/write2/p_opt2.txt')
os.remove('test/write2')
os.remove('test')
os.remove(fname)
os.remove(fname_bak)
@@ -111,6 +114,21 @@ describe(':write', function()
command('write ++p test/write/p_opt.txt')
eq(1, eval("filereadable('test/write/p_opt.txt')"))
eq(0, eval("filereadable('test/write2/p_opt.txt')"))
eq(0, eval("filereadable('test/write2/p_opt2.txt')"))
eq(0, eval("filereadable('test/write3/p_opt3.txt')"))
command('file test/write2/p_opt.txt')
command('set modified')
command('sp test/write2/p_opt2.txt')
command('set modified')
command('sp test/write3/p_opt3.txt')
-- don't set p_opt3.txt modified - assert it isn't written
-- and that write3/ isn't created
command('wall ++p')
eq(1, eval("filereadable('test/write2/p_opt.txt')"))
eq(1, eval("filereadable('test/write2/p_opt2.txt')"))
eq(0, eval("filereadable('test/write3/p_opt3.txt')"))
eq('Vim(write):E32: No file name', pcall_err(command, 'write ++p test_write/'))
if not is_os('win') then
eq(