Skip to content

Commit e6e4bdc

Browse files
feat: optimize hover and simplify command
1 parent 21d8d3b commit e6e4bdc

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/view.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,9 @@ class SearchSidebarProvider implements vscode.WebviewViewProvider {
120120
)
121121
}
122122

123-
vscode.workspace.openTextDocument(fileUri).then(
124-
async (textDoc: vscode.TextDocument) => {
125-
return vscode.window.showTextDocument(textDoc, {
126-
selection: range
127-
})
128-
},
129-
(error: any) => {
130-
console.error('error opening file', filePath)
131-
console.error(error)
132-
}
133-
)
123+
vscode.commands.executeCommand('vscode.open', fileUri, {
124+
selection: range
125+
})
134126
}
135127

136128
private getHtmlForWebview(webview: vscode.Webview) {

src/webview/SearchSidebar/SearchResultList/comps/TreeItem.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ const TreeItem = ({ filePath, matches }: TreeItemProps) => {
5656
w="100%"
5757
justifyContent="flex-start"
5858
key={file + range.start.line + range.start.column}
59+
_hover={{
60+
background: 'var(--vscode-list-inactiveSelectionBackground)'
61+
}}
5962
>
6063
<Box w="20px" />
6164
<CodeBlock match={match} />

0 commit comments

Comments
 (0)