Skip to content

Conversation

@kraftnix
Copy link
Contributor

Unlike the original parent of this fork, it is not currently possible to use a different copy/clipboard command (which used to be implemented via action_callback).

This PR adds a way to override the default copy command, which can be used to add OSC52 support (or use a specific clipboard program like wl-copy).

Test Platforms

  • windows
  • macOS
  • linux

Test Hosts

Test Functions

  • Use GitLink(!) to copy git link (or open in browser).
  • Use GitLink(!) blame to copy the /blame link (or open in browser).
  • Use GitLink(!) default_branch to open the /main//master link in browser (or open in browser).
  • Use GitLink(!) current_branch to open the current branch link in browser (or open in browser).
  • Copy git link in a symlink directory of git repo.
  • Copy git link in an un-pushed git branch, and receive an expected error.
  • Copy git link in a pushed git branch but edited file, and receive a warning says the git link could be wrong.
  • Copy git link with 'file' and 'rev' parameters.

@linrongbin16
Copy link
Owner

This feature looks great, thank you, will take a look later

@linrongbin16
Copy link
Owner

linrongbin16 commented Oct 28, 2025

I will fix the lint issue in ci.


Done in e4cdebb


local clipboard_override = require('gitlinker.configs').get()['clipboard_override']
if clipboard_override then
M.clipboard = clipboard_override
Copy link
Owner

@linrongbin16 linrongbin16 Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @kraftnix ,

This part is like a cycle-dependency between "gitlinker.actions" and "gitlinker.configs".

I moved this part to "setup" here: https://github.com/linrongbin16/gitlinker.nvim/pull/280/files#diff-e85b0a73f385d3b9be62752dbc0afd2ca8eba8b75c12d7667a5514b8b35755ee

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I wasn't quite sure where to put the override when testing before.

@linrongbin16 linrongbin16 merged commit 7df8cb9 into linrongbin16:master Oct 28, 2025
5 checks passed
@kraftnix kraftnix deleted the clipboard_override branch October 29, 2025 01:07
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.

2 participants