feat: ":write ++p" creates parent dirs #20835

- `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if
   they do not exist
    - Note: `:foo ++…` is usually for options. No existing options have
      a single-char abbreviation (presumably by design), so it's safe to
      special-case `++p` here.
- Same for `writefile(…, 'foo/bar/baz.txt', 'p')`
- `BufWriteCmd` can see the ++p flag via `v:cmdarg`.

closes #19884
This commit is contained in:
Victor Blanchard
2022-11-07 04:31:50 +01:00
committed by GitHub
parent 10fbda508c
commit d337814906
11 changed files with 116 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ typedef enum {
///< be used with kFileCreateOnly.
kFileNonBlocking = 128, ///< Do not restart read() or write() syscall if
///< EAGAIN was encountered.
kFileMkDir = 256,
} FileOpenFlags;
static inline bool file_eof(const FileDescriptor *fp)