Repository navigation
Support keyboard shortcut for formatted Vs Unformatted paste - #59
theinterned merged 15 commits into
Conversation
|
Open to feedback/thoughts on this approach Vs in #60 Going with this approach based on feedback and ease of understanding. |
manuelpuyol
left a comment
There was a problem hiding this comment.
I kinda prefer this version because we have a single state instead of having to manage a different state for each installation.
Maybe we should add a comment about the order of the installs to make sure we don't add things after the installUnformattedAfter.
For that very reason the the approach in #60 seems neat and maintainable. 🤷♀️ |
|
@theinterned - this PR seems good to go now! 😄 |
to avoid fragility of the install before and after approach
theinterned
left a comment
There was a problem hiding this comment.
Thanks for all the hard work you put into this! 👏
I made a few small changes to the tests. I hope you don't mind!
Ref: https://github.com/github/special-projects/issues/966
Context:
Add support for keyboard shortcuts where when :
cmd/ctrl+ shift + vpastes unformatted content like for paste linkshttp://...andcmd/ctrl + vformatted auto linked link on selected text like[...](http://...)Supports Cmd+Shift+V (Chrome) / Cmd+Shift+Opt+V (Safari, Firefox and Edge) to mimic paste and match style shortcut on MacOS.
https://github.com/proxy/user-images.githubusercontent.com/18541122/167979710-b7cbb3ac-22db-4692-8e9c-24cda14ebee7.mov
Approach 1:This approach takes into account subscription pattern to install/uninstall
keydownandpasteevents to set flag/state of keys pressed to decide paste. Since all thekeydownevents happen first, and then paste - using this approach we can set/unset the weakMap used to flag the state of key combinations correctly to achieve consistency in paste.What reviewers should know
While writing tests for this keyboard shortcut to skip formatting when
cmd/ctrl+ shift + v- we learnt that asserting actual content change ( non-markdown ) would not be possible in test environment. Hence leaving the test with comments for future reference.But feel free to provide any feedback.
🍐 @theinterned