Commit: runtime(doc): clarify buffer deletion on popup_close()

36 views
Skip to first unread message

Christian Brabandt

unread,
Jan 8, 2025, 8:15:18 AM1/8/25
to vim...@googlegroups.com
runtime(doc): clarify buffer deletion on popup_close()

Commit: https://github.com/vim/vim/commit/1f045f324d0a8e9e897e5ed49c4e21aa9c2a538e
Author: Christian Brabandt <c...@256bit.org>
Date: Wed Jan 8 14:09:02 2025 +0100

runtime(doc): clarify buffer deletion on popup_close()

Reported-by: Lifepillar <lifep...@lifepillar.me>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt
index b1e6c0cb3..06acf3918 100644
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -1,4 +1,4 @@
-*popup.txt* For Vim version 9.1. Last change: 2024 Dec 19
+*popup.txt* For Vim version 9.1. Last change: 2025 Jan 08


VIM REFERENCE MANUAL by Bram Moolenaar
@@ -257,8 +257,8 @@ popup_clear([{force}])


popup_close({id} [, {result}]) *popup_close()*
- Close popup {id}. The window and the associated buffer will
- be deleted.
+ Close popup {id}. The window will be deleted. The associated
+ buffer will be deleted, if the popup created a new buffer.

If the popup has a callback it will be called just before the
popup window is deleted. If the optional {result} is present

shane.qian

unread,
Jan 8, 2025, 10:51:48 AM1/8/25
to vim...@googlegroups.com, chrisbra
> Reported-by: Lifepillar <lifep...@lifepillar.me>
> Signed-off-by: Christian Brabandt <c...@256bit.org>
>
> popup_close({id} [, {result}]) *popup_close()*
> - Close popup {id}. The window and the associated buffer will
> - be deleted.
> + Close popup {id}. The window will be deleted. The associated
> + buffer will be deleted, if the popup created a new buffer.
>
> If the popup has a callback it will be called just before the
> popup window is deleted. If the optional {result} is present

`if the popup created a new buffer` if the window was deleted as it previously
said `The window will be deleted`, then how it created a new buffer?

looks it made me more confuse, aha~ or i misunderstood something?

--
shane.xb.qian

chrisbra

unread,
Jan 8, 2025, 11:45:07 AM1/8/25
to vim...@googlegroups.com
Please see the previous message that led to this:
https://groups.google.com/g/vim_use/c/X6KPMOmdv40/m/A3zKQvP5CAAJ
and check the help at :h popup_create-arguments.

Thanks,
Christian
--
As part of the conversion, computer specialists rewrote 1,500 programs;
a process that traditionally requires some debugging.
-- USA Today, referring to the Internal Revenue Service
conversion to a new computer system.

shane qian

unread,
Jan 8, 2025, 12:51:36 PM1/8/25
to vim...@googlegroups.com
Hi, 
sorry cannot open google link here unfortunately.
what I means: a buffer cannot be created without a window existed and displayed it in a popup, or if had, means that window had been changed already.
i supposed so, if yes, perhaps better to re phrase it, or let it be~


--
shane.xb.qian

Christian Brabandt

unread,
Jan 8, 2025, 2:44:26 PM1/8/25
to vim...@googlegroups.com
But you can check the mentioned help entry. So let it be.

Thanks,
Christian
--
As for the women, though we scorn and flout 'em,
We may live with, but cannot live without 'em.
-- Frederic Reynolds

shane.qian

unread,
Jan 8, 2025, 5:52:50 PM1/8/25
to vim...@googlegroups.com
On 25/01/08 08:44PM, Christian Brabandt wrote:
>
> On Wed, 08 Jan 2025, shane qian wrote:
>
> > Hi,
> > sorry cannot open google link here unfortunately.
> > what I means: a buffer cannot be created without a window existed and displayed it in a popup, or if had, means that window had been changed already.
> > i supposed so, if yes, perhaps better to re phrase it, or let it be~
>
> But you can check the mentioned help entry. So let it be.
>

echow "foo"
echom popup_findecho() " 1001
echom winbufnr(popup_findecho()) " 2
ls!

call popup_close(1001)

echow "bar"
echom popup_findecho() " 1002
echom winbufnr(popup_findecho()) " 2
ls!

--
shane.xb.qian

Christian Brabandt

unread,
Jan 9, 2025, 7:46:13 AM1/9/25
to vim...@googlegroups.com

On Thu, 09 Jan 2025, shane.qian wrote:

> echow "foo"
> echom popup_findecho() " 1001
> echom winbufnr(popup_findecho()) " 2
> ls!
>
> call popup_close(1001)
>
> echow "bar"
> echom popup_findecho() " 1002
> echom winbufnr(popup_findecho()) " 2
> ls!

It's unclear to me what you are trying to tell me.

Thanks,
Christian
--
<Overfiend> we're calling 2.2 _POTATO_??
Reply all
Reply to author
Forward
0 new messages