Skip to content

Commit d4ae4a6

Browse files
author
Jackson Kearl
committed
Enable search editor in non-HOME envs
1 parent e1b06c9 commit d4ae4a6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

extensions/search-result/src/extension.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,16 @@ export function activate(context: vscode.ExtensionContext) {
121121

122122

123123
function relativePathToUri(path: string, resultsUri: vscode.Uri): vscode.Uri | undefined {
124-
if (pathUtils.isAbsolute(path)) { return vscode.Uri.file(path); }
124+
if (pathUtils.isAbsolute(path)) {
125+
return vscode.Uri
126+
.file(path)
127+
.with({ scheme: process.env.HOME ? 'file' : 'vscode-userdata' });
128+
}
129+
125130
if (path.indexOf('~/') === 0) {
126-
return vscode.Uri.file(pathUtils.join(process.env.HOME!, path.slice(2)));
131+
return vscode.Uri
132+
.file(pathUtils.join(process.env.HOME ?? '', path.slice(2)))
133+
.with({ scheme: process.env.HOME ? 'file' : 'vscode-userdata' });
127134
}
128135

129136
const uriFromFolderWithPath = (folder: vscode.WorkspaceFolder, path: string): vscode.Uri =>

0 commit comments

Comments
 (0)