Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit abf2574

Browse files
darkwingjasonLaster
authored andcommitted
Highlight original source for sources tree (#5511)
1 parent 9789111 commit abf2574

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/PrimaryPanes/SourcesTree.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
getExtension
4343
} from "../../utils/sources-tree";
4444

45+
import { getRawSourceURL } from "../../utils/source";
4546
import { copyToTheClipboard } from "../../utils/clipboard";
4647
import { features } from "../../utils/prefs";
4748

@@ -132,7 +133,7 @@ class SourcesTree extends Component<Props, State> {
132133
nextProps.selectedSource != selectedSource
133134
) {
134135
const highlightItems = getDirectories(
135-
nextProps.selectedSource.get("url"),
136+
getRawSourceURL(nextProps.selectedSource.get("url")),
136137
sourceTree
137138
);
138139

src/utils/source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function getPrettySourceURL(url: ?string): string {
115115
* @static
116116
*/
117117
export function getRawSourceURL(url: string): string {
118-
return url.replace(/:formatted$/, "");
118+
return url ? url.replace(/:formatted$/, "") : url;
119119
}
120120

121121
function resolveFileURL(

0 commit comments

Comments
 (0)