[vim/vim] Improve the Warnings about missing clipboard registers (PR #16069)

20 views
Skip to first unread message

Christian Brabandt

unread,
Nov 16, 2024, 8:44:40 AM11/16/24
to vim/vim, Subscribed
  • Make it translatable
  • Use a different warning, when clipboard support was not compiled in

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/16069

Commit Summary

  • 79403d8 Improve the Warnings about missing clipboard registers

File Changes

(4 files)

Patch Links:


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

Christian Brabandt

unread,
Nov 16, 2024, 8:56:35 AM11/16/24
to vim/vim, Push

@chrisbra pushed 1 commit.

  • e369514 Improve the Warnings about missing clipboard registers


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16069/before/79403d89a3abfc38c35fc5702bd66d2f21e462dc/after/e3695147a450ebf9bb1642af885f474830ac8976@github.com>

Luca Saccarola

unread,
Nov 16, 2024, 2:28:47 PM11/16/24
to vim/vim, Subscribed

@saccarosium requested changes on this pull request.


In src/message.c:

> @@ -4071,7 +4070,11 @@ msg_warn_missing_clipboard(void)
 {
     if (!global_busy && !did_warn_clipboard)
     {
-       msg(_(warn_clipboard));
+#ifdef FEAT_CLIPBOARD
+       msg(_("W23: Clipboard register not available, using register 0"));
+#else
+       msg(_("W24: Clipboard register not available"));

I think this should be a little more specific about the fact that vim doesn't have this functionality compiled with ideally a link to a doc detailing what is +clipboard. Mainly for new users that they will likely now about +clipboard and the fact that you need to recompile vim.

Probably something like: "Clipboard register is not available in this build of vim. To learn more read :h clipboard"


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/pull/16069/review/2440793595@github.com>

Gary Johnson

unread,
Nov 16, 2024, 3:36:41 PM11/16/24
to reply+ACY5DGBDYMDXD2XARG...@reply.github.com, vim...@googlegroups.com
On 2024-11-16, Luca Saccarola wrote:
> @saccarosium requested changes on this pull request.
>
> -------------------------------------------------------------------------------
>
> In src/message.c:
>
> > @@ -4071,7 +4070,11 @@ msg_warn_missing_clipboard(void)
> {
> if (!global_busy && !did_warn_clipboard)
> {
> - msg(_(warn_clipboard));
> +#ifdef FEAT_CLIPBOARD
> + msg(_("W23: Clipboard register not available, using register 0"));
> +#else
> + msg(_("W24: Clipboard register not available"));
>
> I think this should be a little more specific about the fact that vim doesn't
> have this functionality compiled with ideally a link to a doc detailing what is
> +clipboard. Mainly for new users that they will likely now about +clipboard and
> the fact that you need to recompile vim.
>
> Probably something like: "Clipboard register is not available in this build of
> vim. To learn more read :h clipboard"

But new users should know about, or be made aware of, ":help W23".
I don't think we should be turning error messages into essays when
we have a very good help system.

Regards,
Gary

vim-dev ML

unread,
Nov 16, 2024, 3:37:10 PM11/16/24
to vim/vim, vim-dev ML, Your activity


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16069/c2480802745@github.com>

Luca Saccarola

unread,
Nov 16, 2024, 3:55:55 PM11/16/24
to vim/vim, vim-dev ML, Comment

TLDR: at least try to tell the user why the clipboard is unavailable.

But new users should know about, or be made aware of, ":help W23".

IMHO Errors should be helpful and guide you to the solution. The all W* is not really user friendly TBH (but that is another discussion). If I'm a new user how I suppose to know that that W24 is a helptag to use in the docs? I've used vim for like 6 years and discovered this not even that long ago and I'm certain that will confuse people at least from my personal experience teaching vim and helping others triage issues.

I don't think we should be turning error messages into essays

Man you read really short essays :)


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/16069/c2480807657@github.com>

Christian Brabandt

unread,
Nov 17, 2024, 3:38:38 AM11/17/24
to vim/vim, vim-dev ML, Push

@chrisbra pushed 1 commit.

  • cfae0d5 Improve the Warnings about missing clipboard registers

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16069/before/e3695147a450ebf9bb1642af885f474830ac8976/after/cfae0d5e5d3c8b02b0b9b0b3f45122997f7d4ddf@github.com>

Christian Brabandt

unread,
Nov 17, 2024, 3:39:22 AM11/17/24
to vim/vim, vim-dev ML, Comment

I have improved the documentation and added a reference to :h W24 in the warning message


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/16069/c2481039908@github.com>

Luca Saccarola

unread,
Nov 17, 2024, 3:46:52 AM11/17/24
to vim/vim, vim-dev ML, Comment

LGTM!


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/16069/c2481046417@github.com>

Christian Brabandt

unread,
Nov 17, 2024, 6:37:21 AM11/17/24
to vim/vim, vim-dev ML, Push

@chrisbra pushed 1 commit.

  • 421aa38 Improve the Warnings about missing clipboard registers

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/16069/before/cfae0d5e5d3c8b02b0b9b0b3f45122997f7d4ddf/after/421aa38764593c0e51c42914bd6168f62c4a34d3@github.com>

Christian Brabandt

unread,
Nov 17, 2024, 10:08:36 AM11/17/24
to vim/vim, vim-dev ML, Comment

Closed #16069 via 8b94afc.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/16069/issue_event/15325118213@github.com>

Reply all
Reply to author
Forward
0 new messages