Steven Silvester 8 år sedan
förälder
incheckning
536e9ee240
2 ändrade filer med 3 tillägg och 7 borttagningar
  1. 1 0
      src/console/widget.ts
  2. 2 7
      src/notebook/notebook/actions.ts

+ 1 - 0
src/console/widget.ts

@@ -228,6 +228,7 @@ class ConsoleWidget extends Widget {
             })[0];
             if (setNextInput) {
               let text = (setNextInput as any).text;
+              // Ignore the `replace` value and always set the next prompt.
               this.prompt.model.source = text;
             }
           }

+ 2 - 7
src/notebook/notebook/actions.ts

@@ -904,13 +904,8 @@ namespace Private {
         let cell = parent.model.factory.createCodeCell();
         cell.source = text;
         let cells = parent.model.cells;
-        for (let i = 0; i < cells.length; i++) {
-          let widget = parent.childAt(i);
-          if (widget === child) {
-            cells.insert(i + 1, cell);
-            break;
-          }
-        }
+        let i = cells.indexOf(child.model);
+        cells.insert(i + 1, cell);
       }
     }
   }