Skip to content

Commit 48cee53

Browse files
committed
runtime(doc): Clarify :bd behaviour
closes: #19389 Signed-off-by: Christian Brabandt <[email protected]>
1 parent c5f312a commit 48cee53

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

runtime/doc/windows.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*windows.txt* For Vim version 9.1. Last change: 2025 Dec 03
1+
*windows.txt* For Vim version 9.1. Last change: 2026 Feb 13
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1210,15 +1210,22 @@ list of buffers. |unlisted-buffer|
12101210
:bd[elete][!] [N]
12111211
Unload buffer [N] (default: current buffer) and delete it from
12121212
the buffer list. If the buffer was changed, this fails,
1213-
unless when [!] is specified, in which case changes are lost.
1213+
unless [!] is specified, in which case changes are lost.
12141214
The file remains unaffected. Any windows for this buffer are
12151215
closed. If buffer [N] is the current buffer, another buffer
12161216
will be displayed instead. This is the most recent entry in
12171217
the jump list that points into a loaded buffer.
1218+
12181219
Actually, the buffer isn't completely deleted, it is removed
12191220
from the buffer list |unlisted-buffer| and option values,
12201221
variables and mappings/abbreviations for the buffer are
1221-
cleared. Examples: >
1222+
cleared. If [N] is the last listed buffer in a window (i.e.,
1223+
there is no other listed buffer to switch to), the buffer is
1224+
emptied instead of being unloaded. The window is not closed,
1225+
and the buffer may be reused as a new buffer |buffer-reuse|.
1226+
This ensures every window always has a valid buffer.
1227+
1228+
Examples: >
12221229
:.,$-bdelete " delete buffers from the current one to
12231230
" last but one
12241231
:%bdelete " delete all buffers

0 commit comments

Comments
 (0)