Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added Context Menu for markdown preview mode and copy url when … #3066


None yet
4 participants
Copy link

commented Jun 9, 2019



Apologies in advance if i have missed steps here. First time contributing to this repo.
This adds a context menu to the Markdown Preview mode with the usual options + the new Copy Url option when right clicking a hyperlink.

Issue fixed


Type of changes

  • ⚪️ Bug fix (Change that fixed an issue)
  • ⚪️ Breaking change (Change that can cause existing functionality to change)
  • ⚪️ Improvement (Change that improves the code. Maybe performance or development improvement)
  • 🔘 Feature (Change that adds new functionality)
  • ⚪️ Documentation change (Change that modifies documentation. Maybe typo fixes)


  • 🔘 My code follows the project code style
  • 🔘 I have written test for my code and it has been tested
  • 🔘 All existing tests have been passed
  • 🔘 I have attached a screenshot/video to visualize my change if possible

This comment has been minimized.

Copy link

commented Jun 11, 2019

I was wondering why there was no 'Copy Url' on that context menu. Great addition. Hope it makes it through review.

const menu = buildMarkdownPreviewContextMenu(this, event)
if (menu != null) {
setTimeout(() => menu.popup(remote.getCurrentWindow()), 30)

This comment has been minimized.

Copy link

ZeroX-DG Jun 15, 2019


Why do you need setTimeout here?

This comment has been minimized.

Copy link

nathan-castlehow Jun 15, 2019


Hmm great question. Copied this from the Code editor context menu, it has the same behaviour. Do we know why it was added in there? Might be worth just removing it in both places?

This comment has been minimized.

Copy link

ZeroX-DG Jun 16, 2019


That code was added in this PR: #2338. @ehhc can you explain why you need setTimeout there?

This comment has been minimized.

Copy link

ehhc Jun 16, 2019


To be honest, i can't remember.
Only thing i might imagine is, that setTimeout forces it to be in a separated thread --> not blocking the main gui...
But: there is a good chance, that that's bullshit...

Does it work without the timeout? If yes, feel free to remove it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.