瀏覽代碼

Don’t activate the notebook by default (putting the notebook into command mode)

Jason Grout 6 年之前
父節點
當前提交
5254411c0b
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/notebook-extension/src/index.ts

+ 3 - 1
packages/notebook-extension/src/index.ts

@@ -769,7 +769,9 @@ function addCommands(app: JupyterLab, services: ServiceManager, tracker: Noteboo
   commands.addCommand(CommandIDs.runInConsole, {
     label: 'Run Selected Text or Current Line in Console',
     execute: args => {
-      const current = getCurrent(args);
+      // Default to not activating the notebook (thereby putting the notebook
+      // into command mode)
+      const current = getCurrent({activate: false, ...args});
 
       if (current) {
         const { context, content } = current;