Skip to content

Conversation

@twio142
Copy link
Contributor

@twio142 twio142 commented Oct 8, 2025

Support different actions on hint clicked depending on the shift key.

api.mapkey('yf', '#7Yank link url', () => {
  api.Hints.create('*[href]', (element, shiftKey) => {
    // without shift: copy link URL
    // with shift: copy markdown link
    const link = shiftKey ? `[${element.textContent}](${element.href})` : element.href;
    api.Clipboard.write(link);
  });
});

support different actions on hint clicked depending on shift key
@twio142 twio142 force-pushed the feat/hint-shiftkey branch from 8e50f25 to 80a3c98 Compare October 8, 2025 17:57
@brookhong brookhong merged commit c35875c into brookhong:master Oct 9, 2025
0 of 2 checks passed
@twio142 twio142 deleted the feat/hint-shiftkey branch October 11, 2025 01:46
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