CMS Development

keegan-sbm
Mitwirkender/Mitwirkende

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

In the old code editor, the CMD+D command used to duplicate the current line, and now it just deletes it. This was a super usefult shortcut. Deleting a line is not super useful.

 

I'm sad now. Is there anything that can make me unsad?

0 Upvotes
1 Akzeptierte Lösung
keegan-sbm
Lösung
Mitwirkender/Mitwirkende

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung
CodeMirror.keyMap.macDefault["Cmd-D"] = function(cm){
    var current_cursor = cm.doc.getCursor();
    var line_content = cm.doc.getLine(current_cursor.line);
    CodeMirror.commands.goLineEnd(cm);
    CodeMirror.commands.newlineAndIndent(cm);
    CodeMirror.commands.goLineLeft(cm);
    cm.doc.replaceSelection(line_content);
    cm.doc.setCursor(current_cursor.line + 1, current_cursor.ch);
};

Running ^ from the chrome console brings back duplicate line functionality to CMD+D.

Lösung in ursprünglichem Beitrag anzeigen

7 Antworten
tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

CMD+SHIFT+D

(now you're unsad) 😄

0 Upvotes
keegan-sbm
Mitwirkender/Mitwirkende

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

I want to believe that's working for somebody. For me (in chrome) that's just causing the bookmarks dialogue to pop up. Cest la vie. Thanks for trying though.

0 Upvotes
tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

The bookmark does appear if I'm not "focused" in the editor, but once I click on any code in the editor, the duplicate works. Not sure if that helps your scenario.

0 Upvotes
keegan-sbm
Mitwirkender/Mitwirkende

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

Tried a couple variations to no avail, although maybe its an issue of too many hubspot tabs open or stale session or something. I bet this is something a crafty bookmarklet could fix.

keegan-sbm
Lösung
Mitwirkender/Mitwirkende

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung
CodeMirror.keyMap.macDefault["Cmd-D"] = function(cm){
    var current_cursor = cm.doc.getCursor();
    var line_content = cm.doc.getLine(current_cursor.line);
    CodeMirror.commands.goLineEnd(cm);
    CodeMirror.commands.newlineAndIndent(cm);
    CodeMirror.commands.goLineLeft(cm);
    cm.doc.replaceSelection(line_content);
    cm.doc.setCursor(current_cursor.line + 1, current_cursor.ch);
};

Running ^ from the chrome console brings back duplicate line functionality to CMD+D.

tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

Yep, you're right, this is from their project bundle - (no duplicate) 

nodups.png

 

Also, found this in the source code, kinda funny 😄

fired.png

keegan-sbm
Mitwirkender/Mitwirkende

Keyboard shortcut for duplicate line was changed in new design editor and that makes me sad.

lösung

rofl

0 Upvotes