Skip to content

Commit ea6cf14

Browse files
committed
Cmd+Backspace should delete from cursor to the beginning of line on macOS
See issue #815
1 parent fc7f2b9 commit ea6cf14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ExtendedScintilla.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ ExtendedScintilla::ExtendedScintilla(QWidget* parent) :
6565
// Alt+Backspace on Mac is expected to delete one word to the left,
6666
// instead of undoing (default Scintilla binding).
6767
QsciCommand * command = standardCommands()->find(QsciCommand::DeleteWordLeft);
68-
command->setAlternateKey(Qt::AltModifier+Qt::Key_Backspace);
68+
command->setKey(Qt::AltModifier+Qt::Key_Backspace);
69+
// And Cmd+Backspace should delete from cursor to the beginning of line
70+
command = standardCommands()->find(QsciCommand::DeleteLineLeft);
71+
command->setKey(Qt::ControlModifier+Qt::Key_Backspace);
6972
#endif
7073

7174
QShortcut* shortcutPrint = new QShortcut(QKeySequence(tr("Ctrl+P")), this, nullptr, nullptr, Qt::WidgetShortcut);

0 commit comments

Comments
 (0)