mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fix(command_palette): text editor-based issues not working
This commit is contained in:
		
							parent
							
								
									0e6b10e400
								
							
						
					
					
						commit
						11d086ef12
					
				@ -244,6 +244,8 @@ class CommandRegistry {
 | 
			
		||||
        if (command.keyboardAction && command.commandName) {
 | 
			
		||||
            if (command.keyboardAction.scope === "note-tree") {
 | 
			
		||||
                this.executeWithNoteTreeFocus(command.commandName);
 | 
			
		||||
            } else if (command.keyboardAction.scope === "text-detail") {
 | 
			
		||||
                this.executeWithTextDetail(command.commandName);
 | 
			
		||||
            } else {
 | 
			
		||||
                appContext.triggerCommand(command.commandName);
 | 
			
		||||
            }
 | 
			
		||||
@ -272,6 +274,17 @@ class CommandRegistry {
 | 
			
		||||
            node: activeNode
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private async executeWithTextDetail(actionName: CommandNames) {
 | 
			
		||||
        const typeWidget = await appContext.tabManager.getActiveContext()?.getTypeWidget();
 | 
			
		||||
        if (!typeWidget) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        typeWidget.triggerCommand(actionName, {
 | 
			
		||||
            ntxId: appContext.tabManager.activeNtxId
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const commandRegistry = new CommandRegistry();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user