Skip to content

Commit

Permalink
ctrl+x also chats
Browse files Browse the repository at this point in the history
  • Loading branch information
TodePond committed Mar 1, 2025
1 parent 0788b2f commit 11b4b78
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class PastaMirror {
})),
// Disable Backspace
// chat current line..
...['Shift-Enter'].map((key) => ({
...['Shift-Enter', 'Ctrl-x', 'Mod-x'].map((key) => ({
key,
run: (view) => {
let from = view.state.selection.main.from;
Expand Down Expand Up @@ -167,11 +167,15 @@ export class PastaMirror {
color: doc.session.userColor.color,
});

const transaction = view.state.update({
changes: { from, to, insert: '' },
});
view.dispatch(transaction);
return true;
if (key === 'Shift-Enter') {
const transaction = view.state.update({
changes: { from, to, insert: '' },
});
view.dispatch(transaction);
return true;
}

return false;
},
})),
// overrides Enter to disable auto indenting..
Expand Down

0 comments on commit 11b4b78

Please sign in to comment.