Skip to content

Commit

Permalink
fix: support deletion of character using [shift+backspace] command sh…
Browse files Browse the repository at this point in the history
…ortcut
  • Loading branch information
Jayaprakash-dev committed Jan 9, 2024
1 parent 87eabfb commit c2341e7
Show file tree
Hide file tree
Showing 3 changed files with 510 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ final List<CommandShortcutEvent> standardCommandShortcutEvents = [
convertToParagraphCommand,
...tableCommands,
backspaceCommand,
deleteLeftCharacterCommand,
deleteLeftWordCommand,
deleteLeftSentenceCommand,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ final CommandShortcutEvent backspaceCommand = CommandShortcutEvent(
handler: _backspaceCommandHandler,
);

/// Windows / Linux / macOS : shift + backspace
/// Enables the deletion of a character to the left while holding the shift key
///
/// - support
/// - desktop
/// - web
///
final CommandShortcutEvent deleteLeftCharacterCommand = CommandShortcutEvent(
key: 'delete the character on the left',
command: 'shift+backspace',
handler: _backspaceCommandHandler,
);

CommandShortcutEventHandler _backspaceCommandHandler = (editorState) {
final selection = editorState.selection;
final selectionType = editorState.selectionType;
Expand Down
Loading

0 comments on commit c2341e7

Please sign in to comment.