-
Notifications
You must be signed in to change notification settings - Fork 2k
Feature/cmd click on links #5927
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
Feature/cmd click on links #5927
Conversation
…ution with the use of makeLinkAware
sid-bruno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nitpicks to be done
| if (this.editor?._destroyLinkAware) { | ||
| this.editor?._destroyLinkAware?.(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either keep the ?. exec pattern or the if condition
| if (this.editor?._destroyLinkAware) { | ||
| this.editor?._destroyLinkAware?.(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment
| function debounce(fn, delay) { | ||
| let timer; | ||
| return function (...args) { | ||
| clearTimeout(timer); | ||
| timer = setTimeout(() => fn.apply(this, args), delay); | ||
| }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lodash is already a part of the package, use that instead of writing this
efb3c56
into
usebruno:feature/cmd-click-to-links-internal
fix: clean up whitespace and formatting in linkAware functions fix rediff Feature/cmd click on links (usebruno#6132) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it * refactored the community contribution to match Autocomplete's implementation * updated the code to resolve issues caused during merge conflict resolution with the use of makeLinkAware * fix: updated the code to use lodash's debounce and removed redundant undefined checks * fix: correct debouncing test expectation in linkAware.spec.js The test was incorrectly expecting 3 setTimeout calls when debouncing should only result in one active timeout. Updated the test to verify debouncing behavior correctly by checking that setTimeout is called with the correct delay, and that only one execution happens after the debounce delay. * fix: fixed merge issues in linkAware.js * fix: fixed CodeMirror assignment to this.editor * fix: formatting fixes * fix: formatting fix --------- Co-authored-by: abansal21 <[email protected]>
Co-authored-by: Chirag Chandrashekhar <[email protected]> fix: clean up whitespace and formatting in linkAware functions fix rediff Feature/cmd click on links (usebruno#6132) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it * refactored the community contribution to match Autocomplete's implementation * updated the code to resolve issues caused during merge conflict resolution with the use of makeLinkAware * fix: updated the code to use lodash's debounce and removed redundant undefined checks * fix: correct debouncing test expectation in linkAware.spec.js The test was incorrectly expecting 3 setTimeout calls when debouncing should only result in one active timeout. Updated the test to verify debouncing behavior correctly by checking that setTimeout is called with the correct delay, and that only one execution happens after the debounce delay. * fix: fixed merge issues in linkAware.js * fix: fixed CodeMirror assignment to this.editor * fix: formatting fixes * fix: formatting fix --------- Co-authored-by: abansal21 <[email protected]>
fix: clean up whitespace and formatting in linkAware functions fix rediff Feature/cmd click on links (usebruno#6132) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it * refactored the community contribution to match Autocomplete's implementation * updated the code to resolve issues caused during merge conflict resolution with the use of makeLinkAware * fix: updated the code to use lodash's debounce and removed redundant undefined checks * fix: correct debouncing test expectation in linkAware.spec.js The test was incorrectly expecting 3 setTimeout calls when debouncing should only result in one active timeout. Updated the test to verify debouncing behavior correctly by checking that setTimeout is called with the correct delay, and that only one execution happens after the debounce delay. * fix: fixed merge issues in linkAware.js * fix: fixed CodeMirror assignment to this.editor * fix: formatting fixes * fix: formatting fix --------- Co-authored-by: abansal21 <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]>
fix: clean up whitespace and formatting in linkAware functions fix rediff Feature/cmd click on links (usebruno#6132) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it * refactored the community contribution to match Autocomplete's implementation * updated the code to resolve issues caused during merge conflict resolution with the use of makeLinkAware * fix: updated the code to use lodash's debounce and removed redundant undefined checks * fix: correct debouncing test expectation in linkAware.spec.js The test was incorrectly expecting 3 setTimeout calls when debouncing should only result in one active timeout. Updated the test to verify debouncing behavior correctly by checking that setTimeout is called with the correct delay, and that only one execution happens after the debounce delay. * fix: fixed merge issues in linkAware.js * fix: fixed CodeMirror assignment to this.editor * fix: formatting fixes * fix: formatting fix --------- Co-authored-by: abansal21 <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]>
fix: clean up whitespace and formatting in linkAware functions fix rediff Feature/cmd click on links (#6132) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it * refactored the community contribution to match Autocomplete's implementation * updated the code to resolve issues caused during merge conflict resolution with the use of makeLinkAware * fix: updated the code to use lodash's debounce and removed redundant undefined checks * fix: correct debouncing test expectation in linkAware.spec.js The test was incorrectly expecting 3 setTimeout calls when debouncing should only result in one active timeout. Updated the test to verify debouncing behavior correctly by checking that setTimeout is called with the correct delay, and that only one execution happens after the debounce delay. * fix: fixed merge issues in linkAware.js * fix: fixed CodeMirror assignment to this.editor * fix: formatting fixes * fix: formatting fix --------- Co-authored-by: abansal21 <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]>
* feat: Allow ctrl/cmd + click to open URLs present in codemirror editors (#5160) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it --------- Co-authored-by: Sid <[email protected]> * Feature/cmd click on links (#5927) fix: clean up whitespace and formatting in linkAware functions fix rediff Feature/cmd click on links (#6132) * Allow ctrl/cmd + click to open URLs * fix for when user does cmd+tab, then comes back without it * refactored the community contribution to match Autocomplete's implementation * updated the code to resolve issues caused during merge conflict resolution with the use of makeLinkAware * fix: updated the code to use lodash's debounce and removed redundant undefined checks * fix: correct debouncing test expectation in linkAware.spec.js The test was incorrectly expecting 3 setTimeout calls when debouncing should only result in one active timeout. Updated the test to verify debouncing behavior correctly by checking that setTimeout is called with the correct delay, and that only one execution happens after the debounce delay. * fix: fixed merge issues in linkAware.js * fix: fixed CodeMirror assignment to this.editor * fix: formatting fixes * fix: formatting fix --------- Co-authored-by: abansal21 <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]> --------- Co-authored-by: Arun Bansal <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]>
Description
This PR resolves issue #4982.
It introduces support for Cmd+Click (macOS) and Ctrl+Click (Windows/Linux) to open links directly, improving navigation and usability within the editor.
This work builds upon [@abansal21’s original contribution](#5160).
Due to merge conflicts and to ensure consistency across CodeMirror extension implementations, their approach has been slightly refined and the related tests have been updated.
References:
Contribution Checklist