summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-26 11:55:01 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-26 11:55:01 +0100
commitb1d2c8116cb5577961ea109651fb888b5e58265f (patch)
tree3cca94a88929fc31a58d1965da471e7b1e8050a2 /src/fileio.c
parent9b7d2a959646560f5770329f4428c4739eed4656 (diff)
patch 9.0.0272: BufReadCmd not triggered when loading a "nofile" bufferv9.0.0272
Problem: BufReadCmd not triggered when loading a "nofile" buffer. (Maxim Kim) Solution: Call readfile() but bail out before reading a file. (closes #10983)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 6d063a5ab7..1b30e0fed5 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -108,6 +108,7 @@ filemess(
* READ_STDIN read from stdin instead of a file
* READ_BUFFER read from curbuf instead of a file (converting after reading
* stdin)
+ * READ_NOFILE do not read a file, only trigger BufReadCmd
* READ_DUMMY read into a dummy buffer (to check if file contents changed)
* READ_KEEP_UNDO don't clear undo info or read it from a file
* READ_FIFO read from fifo/socket instead of a file
@@ -309,6 +310,9 @@ readfile(
#endif
curbuf->b_op_start = orig_start;
+
+ if (flags & READ_NOFILE)
+ return FAIL;
}
if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0)