diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-30 20:21:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-30 20:21:37 +0200 |
commit | 15e248e37f3925d430f96e945d52d3dc423cdc83 (patch) | |
tree | bd29a54010b6ff38816f4ca523f30e4ba20d61a0 /runtime/doc/eval.txt | |
parent | 2e62b568e91c36adb16dbcc609665170f09f3845 (diff) | |
download | vim-git-15e248e37f3925d430f96e945d52d3dc423cdc83.tar.gz |
patch 8.1.1610: there is no way to add or load a buffer without side effectsv8.1.1610
Problem: There is no way to add or load a buffer without side effects.
Solution: Add the bufadd() and bufload() functions.
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1154c4065..7c457e34e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2272,8 +2272,10 @@ balloon_split({msg}) List split {msg} as used for a balloon browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester +bufadd({name}) Number add a buffer to the buffer list bufexists({expr}) Number |TRUE| if buffer {expr} exists buflisted({expr}) Number |TRUE| if buffer {expr} is listed +bufload({expr}) Number load buffer {expr} if not loaded yet bufloaded({expr}) Number |TRUE| if buffer {expr} is loaded bufname({expr}) String Name of the buffer {expr} bufnr({expr} [, {create}]) Number Number of the buffer {expr} @@ -3132,6 +3134,14 @@ browsedir({title}, {initdir}) When the "Cancel" button is hit, something went wrong, or browsing is not possible, an empty string is returned. +bufadd({name}) *bufadd()* + Add a buffer to the buffer list with {name}. + 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 + buffer is always created. + The buffer will not have' 'buflisted' set. + bufexists({expr}) *bufexists()* The result is a Number, which is |TRUE| if a buffer called {expr} exists. @@ -3161,6 +3171,15 @@ buflisted({expr}) *buflisted()* {expr} exists and is listed (has the 'buflisted' option set). The {expr} argument is used like with |bufexists()|. +bufload({expr}) *bufload()* + Ensure the buffer {expr} 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. + 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 {expr} argument is used like with |bufexists()|. + bufloaded({expr}) *bufloaded()* The result is a Number, which is |TRUE| if a buffer called {expr} exists and is loaded (shown in a window or hidden). |