Skip to content

Commit b9a0f13

Browse files
committed
Updated logic for quick Regex match
1 parent d0f67f5 commit b9a0f13

File tree

1 file changed

+3
-2
lines changed
  • packages/application-extension/src

1 file changed

+3
-2
lines changed

packages/application-extension/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ const opener: JupyterFrontEndPlugin<void> = {
200200
): void => {
201201
const { commands, docRegistry } = app;
202202

203-
const ignoredPattern = new RegExp('/tree(.*)');
203+
const ignoredPattern = new RegExp('/tree/(.*)');
204+
const pathSegmentPattern = new RegExp('\\bnotebooks\\b|\\bedit\\b');
204205
const command = 'router:tree';
205206
commands.addCommand(command, {
206207
execute: (args: any) => {
@@ -212,7 +213,7 @@ const opener: JupyterFrontEndPlugin<void> = {
212213
return;
213214
}
214215

215-
const pathSegments: string[] = parsed.path.split(TREE_PATTERN);
216+
const pathSegments: string[] = parsed.path.split(pathSegmentPattern);
216217
if (pathSegments.length > 1 && pathSegments[0].match(ignoredPattern)) {
217218
return;
218219
}

0 commit comments

Comments
 (0)