diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-25 20:23:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 20:23:29 +0800 |
commit | cd2d3aa48f3531103a3a355d76394301e7b074df (patch) | |
tree | c8e64d07f9fbe43a1ded6c6ec0d10fdfdecbc59e /src/nvim/buffer.c | |
parent | 1b29288709e75064b9188420d46e1028d7ee341e (diff) | |
download | rneovim-cd2d3aa48f3531103a3a355d76394301e7b074df.tar.gz rneovim-cd2d3aa48f3531103a3a355d76394301e7b074df.tar.bz2 rneovim-cd2d3aa48f3531103a3a355d76394301e7b074df.zip |
vim-patch:9.0.0261: bufload() reads a file even if the name is not a file name (#19944)
Problem: bufload() reads a file even if the name is not a file name. (Cyker
Way)
Solution: Do not read the file when the buffer name is not a file name.
(closes vim/vim#10975)
https://github.com/vim/vim/commit/2eddbacd6dc17c84e4bdc41e60e81949a36bb973
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index cc7f650265..d0afaebad9 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -224,7 +224,8 @@ int open_buffer(int read_stdin, exarg_T *eap, int flags) // mark cursor position as being invalid curwin->w_valid = 0; - if (curbuf->b_ffname != NULL) { + // Read the file if there is one. + if (curbuf->b_ffname != NULL && !bt_quickfix(curbuf) && !bt_nofilename(curbuf)) { #ifdef UNIX int save_bin = curbuf->b_p_bin; int perm; |