diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-25 12:45:21 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-25 12:45:21 +0100 |
commit | 2eddbacd6dc17c84e4bdc41e60e81949a36bb973 (patch) | |
tree | e408f43fe5348de1725340122ded24d66e673364 /runtime | |
parent | d6c67629ed05aae436164eec474832daf8ba7420 (diff) |
patch 9.0.0261: bufload() reads a file even if the name is not a file namev9.0.0261
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 #10975)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index c1dea37ad0..7df5e9f099 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1179,7 +1179,8 @@ browsedir({title}, {initdir}) browsing is not possible, an empty string is returned. bufadd({name}) *bufadd()* - Add a buffer to the buffer list with String {name}. + Add a buffer to the buffer list with name {name} (must be a + String). If a buffer for file {name} already exists, return that buffer number. Otherwise return the buffer number of the newly created buffer. When {name} is an empty string then a new @@ -1232,7 +1233,8 @@ bufload({buf}) *bufload()* Ensure the buffer {buf} is loaded. When the buffer name refers to an existing file then the file is read. Otherwise the buffer will be empty. If the buffer was already loaded - then there is no change. + then there is no change. If the buffer is not related to a + file the no file is read (e.g., when 'buftype' is "nofile"). If there is an existing swap file for the file of the buffer, there will be no dialog, the buffer will be loaded anyway. The {buf} argument is used like with |bufexists()|. |