Skip to content

Commit 61003ea

Browse files
committed
Fix attempt for MacOS's link opening shortcut
1 parent 8617f0b commit 61003ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dist/dist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10836,15 +10836,15 @@ function IndentEditor(target_textarea) {
1083610836
});
1083710837
editor.setSize("100%", "100%");
1083810838
editor.on('mousedown', function (cm, e) {
10839-
if (e.ctrlKey) {
10839+
if (e.ctrlKey || e.metaKey) {
1084010840
if ((' ' + e.target.className + ' ').includes(' cm-link ')) {
1084110841
// We don't want to add an extra cursor in in the editor when ctrl-clicking a link
1084210842
e.preventDefault();
1084310843
}
1084410844
}
1084510845
});
1084610846
editor.getWrapperElement().addEventListener('click', function (e) {
10847-
if (e.ctrlKey) {
10847+
if (e.ctrlKey || e.metaKey) {
1084810848
if ((' ' + e.target.className + ' ').includes(' cm-link ')) {
1084910849
var address = e.target.textContent;
1085010850

src/editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function IndentEditor(target_textarea) {
237237
editor.setSize("100%", "100%");
238238

239239
editor.on('mousedown', function(cm, e) {
240-
if (e.ctrlKey) {
240+
if (e.ctrlKey || e.metaKey) {
241241
if ((' ' + e.target.className + ' ').includes(' cm-link ')) {
242242
// We don't want to add an extra cursor in in the editor when ctrl-clicking a link
243243
e.preventDefault();
@@ -246,7 +246,7 @@ function IndentEditor(target_textarea) {
246246
});
247247

248248
editor.getWrapperElement().addEventListener('click', function(e) {
249-
if (e.ctrlKey) {
249+
if (e.ctrlKey || e.metaKey) {
250250
if ((' ' + e.target.className + ' ').includes(' cm-link ')) {
251251
var address = e.target.textContent;
252252

0 commit comments

Comments
 (0)