Improve dialog in package helpcurwin

2 views
Skip to first unread message

Hernán Ibarra Mejia

unread,
3:06 AM (4 hours ago) 3:06 AM
to vim...@vim.org
Dear Vim community,

I like the recently added package helpcurwin, which displays help pages in the
current window (rather than a split). However, there is a confirmation dialog
that appears using `:HelpCurWin` when the current buffer is modified. This is
annoying and inconsistent with the behaviour of other commands that have to
solve the same problem—`:edit` being the prime example.

In pseudo-vimscript, the command currently behaves like this:

```
if (&modified)
confirmation dialog
else
display help in current window
endif
```

At a minimum, it should behave like this:

```
if (&modified && !&hidden)
if (&confirm)
confirmation dialog
else
error
endif
else
display help in current window
endif
```

This is closer to how commands that discard the buffer operate. There is more
room for improvement:

- Support for `<bang>` so that `:HelpCurWin!` forces the operation.
- Take into account special buffer options like 'buftype' and 'bufhidden'.

I am open to discussion and possibly submitting a patch.

Best wishes,
Hernán Ibarra Mejia
(www.nagbu.net)

Christian Brabandt

unread,
3:19 AM (4 hours ago) 3:19 AM
to vim...@googlegroups.com, vim...@vim.org

On Sa, 16 Mai 2026, Hernán Ibarra Mejia wrote:

> Dear Vim community,
>
> I like the recently added package helpcurwin, which displays help pages in the
> current window (rather than a split). However, there is a confirmation dialog
> that appears using `:HelpCurWin` when the current buffer is modified. This is
> annoying and inconsistent with the behaviour of other commands that have to
> solve the same problem—`:edit` being the prime example.
>
> In pseudo-vimscript, the command currently behaves like this:
>
> ```
> if (&modified)
> confirmation dialog
> else
> display help in current window
> endif
> ```
>
> At a minimum, it should behave like this:
>
> ```
> if (&modified && !&hidden)
> if (&confirm)
> confirmation dialog
> else
> error
> endif
> else
> display help in current window
> endif
> ```

I am not so sure about it.
>
> This is closer to how commands that discard the buffer operate. There is more
> room for improvement:
>
> - Support for `<bang>` so that `:HelpCurWin!` forces the operation.

That probably makes sense.

> - Take into account special buffer options like 'buftype' and 'bufhidden'.

Not sure what you have in mind here.

>
> I am open to discussion and possibly submitting a patch.

Please do.

Thanks,
Christian
--
A public debt is a kind of anchor in the storm; but if the anchor be
too heavy for the vessel, she will be sunk by that very weight which
was intended for her preservation.
-- Colton
Reply all
Reply to author
Forward
0 new messages