Skip to content

Support clipboard_provider for GBrowse!#2447

Open
na0x2c6 wants to merge 1 commit intotpope:masterfrom
na0x2c6:support-clipboard_provider
Open

Support clipboard_provider for GBrowse!#2447
na0x2c6 wants to merge 1 commit intotpope:masterfrom
na0x2c6:support-clipboard_provider

Conversation

@na0x2c6
Copy link
Copy Markdown

@na0x2c6 na0x2c6 commented Jan 14, 2026

Hi, I opened a PR to fix #2446
Thanks.


The has('clipboard') check in s:BrowserOpen() does not account for clipboard-providers, which was introduced in Vim v9.1.2081. As a result, :GBrowse! unintentionally skips copying the URL to the clipboard when clipboard-providers is configured.

This commit adds a check for has('clipboard_provider') to fix this behavior. According to the documentation, has('unnamedplus') should detect this, but it did not work in actual environment. Specifically, the check logic focuses on avoiding to throw E354: Invalid register name: '+'.

Link: https://vimhelp.org/eval.txt.html#clipboard-providers
Link: vim/vim@67860ef
Resolves: #2446
Advised-by: Tim Pope code@tpope.net

The `has('clipboard')` check in `s:BrowserOpen()` does not account for
`clipboard-providers`, which was introduced in Vim v9.1.2081. As
a result, `:GBrowse!` unintentionally skips copying the URL to the
clipboard when clipboard-providers is configured.

This commit adds a check for `has('clipboard_provider')` to fix this
behavior. According to the documentation, `has('unnamedplus')` should
detect this, but it did not work in actual environment. Specifically,
the check logic focuses on avoiding to throw `E354: Invalid register
name: '+'`.

Link: https://vimhelp.org/eval.txt.html#clipboard-providers
Link: vim/vim@67860ef
Resolves: tpope#2446
Advised-by: Tim Pope <code@tpope.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

:GBrowse! does not copy to clipboard when using clipboard-providers

1 participant