|
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 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1210,15 +1210,22 @@ list of buffers. |unlisted-buffer| |
1210 | 1210 | :bd[elete][!] [N] |
1211 | 1211 | Unload buffer [N] (default: current buffer) and delete it from |
1212 | 1212 | 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. |
1214 | 1214 | The file remains unaffected. Any windows for this buffer are |
1215 | 1215 | closed. If buffer [N] is the current buffer, another buffer |
1216 | 1216 | will be displayed instead. This is the most recent entry in |
1217 | 1217 | the jump list that points into a loaded buffer. |
| 1218 | + |
1218 | 1219 | Actually, the buffer isn't completely deleted, it is removed |
1219 | 1220 | from the buffer list |unlisted-buffer| and option values, |
1220 | 1221 | 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: > |
1222 | 1229 | :.,$-bdelete " delete buffers from the current one to |
1223 | 1230 | " last but one |
1224 | 1231 | :%bdelete " delete all buffers |
|
0 commit comments