mirror of
https://github.com/zadam/trilium.git
synced 2026-02-08 14:54:26 +01:00
Merge 51325e2f4a91f08519510e199673ba8c4bc045e9 into 72d6b83ec5eef84f80c56d32e3c68df015c0223e
This commit is contained in:
commit
c2a24c20fb
@ -8,21 +8,33 @@ export default class IndentBlockShortcutPlugin extends Plugin {
|
||||
|
||||
init() {
|
||||
this.editor.keystrokes.set( 'Tab', ( _, cancel ) => {
|
||||
const command = this.editor.commands.get( 'indentBlock' );
|
||||
|
||||
if (command && command.isEnabled && !this.isInTable() ) {
|
||||
command.execute();
|
||||
cancel();
|
||||
// In tables, allow default Tab behavior for cell navigation
|
||||
if (this.isInTable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const command = this.editor.commands.get( 'indentBlock' );
|
||||
if (command?.isEnabled) {
|
||||
command.execute();
|
||||
}
|
||||
|
||||
// Always cancel in non-table contexts to prevent widget navigation
|
||||
cancel();
|
||||
} );
|
||||
|
||||
this.editor.keystrokes.set( 'Shift+Tab', ( _, cancel ) => {
|
||||
const command = this.editor.commands.get( 'outdentBlock' );
|
||||
|
||||
if (command && command.isEnabled && !this.isInTable() ) {
|
||||
command.execute();
|
||||
cancel();
|
||||
// In tables, allow default Shift+Tab behavior for cell navigation
|
||||
if (this.isInTable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const command = this.editor.commands.get( 'outdentBlock' );
|
||||
if (command?.isEnabled) {
|
||||
command.execute();
|
||||
}
|
||||
|
||||
// Always cancel in non-table contexts to prevent widget navigation
|
||||
cancel();
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user