From 4da57671d1c4124828fcfbc9a07e8fbfb2d1e4ac Mon Sep 17 00:00:00 2001 From: Ken Warner Date: Fri, 29 Sep 2023 10:38:45 -0400 Subject: [PATCH] Add support for opening files in tree view with a middle click --- src/components/Spaces/TreeView/FolderTreeView.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Spaces/TreeView/FolderTreeView.tsx b/src/components/Spaces/TreeView/FolderTreeView.tsx index e62a37e..411113b 100644 --- a/src/components/Spaces/TreeView/FolderTreeView.tsx +++ b/src/components/Spaces/TreeView/FolderTreeView.tsx @@ -188,7 +188,7 @@ export const TreeItem = forwardRef( openAFile( getAbstractFileAtPath(app, file.item.path), plugin, - e.ctrlKey || e.metaKey + e.ctrlKey || e.metaKey || e.button === 1 ); setActiveFile(pathByString(file.item.path)); setSelectedFiles([file]); @@ -197,7 +197,7 @@ export const TreeItem = forwardRef( openAFile( getAbstractFileAtPath(app, file.item.path), plugin, - e.ctrlKey || e.metaKey + e.ctrlKey || e.metaKey || e.button === 1 ); setActiveFile(pathByString(file.item.path)); setSelectedFiles([file]); @@ -361,6 +361,7 @@ export const TreeItem = forwardRef( onMouseEnter={hoverItem} onKeyDown={onKeyDown} onClick={(e) => openFileAtTarget(data, e)} + onAuxClick={(e) => openFileAtTarget(data, e)} data-path={fileCache.path} onContextMenu={(e) => selectedFiles.length > 1 &&