[vim/vim] Docs are unclear about when buffer-local option values are cleared (deletion vs. wipeout) (Issue #12809)

42 views
Skip to first unread message

Dani Dickstein

unread,
Aug 15, 2023, 2:05:52 PM8/15/23
to vim/vim, Subscribed

Steps to reproduce

The description of :bdelete says:
https://github.com/vim/vim/blob/5b0889b8bf25b0793b1949ec965c94b623900aba/runtime/doc/windows.txt#L1200-L1203

The description of :bwipeout says:
https://github.com/vim/vim/blob/5b0889b8bf25b0793b1949ec965c94b623900aba/runtime/doc/windows.txt#L1226-L1228

Both of these mention clearing option settings. So - when are option settings actually cleared - on :bdelete, or only on :bwipeout when the buffer is "really" deleted? Does it depend on the setting?

Expected behaviour

Clearer documentation for what information is cleared on bdelete vs bwipeout.

Version of Vim

9.0.1712

Environment

.

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809@github.com>

Yegappan Lakshmanan

unread,
Aug 16, 2023, 11:45:42 AM8/16/23
to vim/vim, Subscribed

The buffer-local options are cleared for both the ":bdelete" and the ":bwipeout" commands. Note that you can wipeout a buffer using the ":bwipeout" command without first deleting the buffer using the ":bdelete" command. You can also use the ":bdelete" command to delete a buffer without wiping out the buffer. In both cases, the buffer-local options will be cleared.

Refer to the following code:
https://github.com/vim/vim/blob/master/src/buffer.c#L940
https://github.com/vim/vim/blob/master/src/buffer.c#L786
https://github.com/vim/vim/blob/master/src/buffer.c#L778


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1680856085@github.com>

Dani Dickstein

unread,
Aug 16, 2023, 12:58:21 PM8/16/23
to vim/vim, Subscribed

Got it - I think "option settings are lost" in the wipeout text is confusing then - a different example should be chosen, e.g., buffer-local autocmds are cleared.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1680959473@github.com>

Christian Brabandt

unread,
Aug 21, 2023, 2:03:35 AM8/21/23
to vim/vim, Subscribed

so this can be closed?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1685702674@github.com>

Dani Dickstein

unread,
Aug 21, 2023, 8:53:35 AM8/21/23
to vim/vim, Subscribed

Ideally the confusing text should be updated

On Mon, Aug 21, 2023 at 2:03 AM Christian Brabandt ***@***.***>
wrote:

> so this can be closed?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/vim/vim/issues/12809#issuecomment-1685702674>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAGD5T5SVFAOWJL7DN3ZQULXWL2Z5ANCNFSM6AAAAAA3RMUMOA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1686272737@github.com>

Christian Brabandt

unread,
Aug 21, 2023, 9:07:34 AM8/21/23
to vim/vim, Subscribed

but both commands are clearing out buffer-local options. Isn't that clear? Do you have a doc improvement?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1686295256@github.com>

Dani Dickstein

unread,
Aug 21, 2023, 2:17:08 PM8/21/23
to vim/vim, Subscribed

This :bwipeout text is contrasting it with what :bdelete does. It's "like :bdelete", but also does . So it's misleading to include something in that list that :bdelete also does. As I said above, a different example should be chosen, e.g., buffer-local autocmds being cleared.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1686806544@github.com>

Christian Brabandt

unread,
Aug 22, 2023, 4:48:16 PM8/22/23
to vim/vim, Subscribed

I don't read that as contrasting:

https://github.com/vim/vim/blob/544b209a2d4b10e0a4874c925036def30d33d708/runtime/doc/windows.txt#L1226-L1229

Like bdelete, but really delete the buffer. so everything is lost. And then come examples of what all will be lost (but that does not relate or contrast to what :bd does but are just examples of what all will be lost when using bwipeout). Yes, bdelete may also delete part of that, but that is not the point here.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1688911189@github.com>

Christian Brabandt

unread,
Aug 22, 2023, 4:51:50 PM8/22/23
to vim/vim, Subscribed

FWIW: I wrote the previous comment, after I started looking at the help file and was trying to clarify the docs as part of #12790

But I don't think this is required. So let me close this. Thanks.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12809/1688915148@github.com>

Christian Brabandt

unread,
Aug 22, 2023, 4:51:52 PM8/22/23
to vim/vim, Subscribed

Closed #12809 as not planned.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/12809/issue_event/10163059824@github.com>

Reply all
Reply to author
Forward
0 new messages