From: Christian Brabandt Date: Fri, 13 Feb 2026 20:53:49 +0000 (+0000) Subject: runtime(doc): Clarify :bd behaviour X-Git-Tag: v9.2.0000~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48cee53615069e3a5a04be265440180e29f9997a;p=thirdparty%2Fvim.git runtime(doc): Clarify :bd behaviour closes: #19389 Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 7b82486558..d585669f4d 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 9.1. Last change: 2025 Dec 03 +*windows.txt* For Vim version 9.1. Last change: 2026 Feb 13 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1210,15 +1210,22 @@ list of buffers. |unlisted-buffer| :bd[elete][!] [N] Unload buffer [N] (default: current buffer) and delete it from the buffer list. If the buffer was changed, this fails, - unless when [!] is specified, in which case changes are lost. + unless [!] is specified, in which case changes are lost. The file remains unaffected. Any windows for this buffer are closed. If buffer [N] is the current buffer, another buffer will be displayed instead. This is the most recent entry in the jump list that points into a loaded buffer. + Actually, the buffer isn't completely deleted, it is removed from the buffer list |unlisted-buffer| and option values, variables and mappings/abbreviations for the buffer are - cleared. Examples: > + cleared. If [N] is the last listed buffer in a window (i.e., + there is no other listed buffer to switch to), the buffer is + emptied instead of being unloaded. The window is not closed, + and the buffer may be reused as a new buffer |buffer-reuse|. + This ensures every window always has a valid buffer. + + Examples: > :.,$-bdelete " delete buffers from the current one to " last but one :%bdelete " delete all buffers