Browse Source

Reorganize

Roshan Prabhakar 8 years ago
parent
commit
e0c1c57075
1 changed files with 9 additions and 8 deletions
  1. 9 8
      src/notebook/codemirror/cells/editor.ts

+ 9 - 8
src/notebook/codemirror/cells/editor.ts

@@ -250,18 +250,19 @@ class CodeMirrorCellEditorWidget extends CodeMirrorWidget implements ICellEditor
       return this.onTabEvent(event, ch, line);
     }
 
-    // If the shift key is pressed, don't move to top cell
-    if (line === 0 && ch === 0 && event.keyCode === UP_ARROW && event.shiftKey === false) {
-      this.edgeRequested.emit('top');
-      return;
+    if (line === 0 && ch === 0 && event.keyCode === UP_ARROW) {
+        if (!event.shiftKey) {
+          this.edgeRequested.emit('top');
+        }
+        return;
     }
 
     let lastLine = doc.lastLine();
     let lastCh = doc.getLineHandle(lastLine).text.length;
-    
-    // If the shift key is pressed, don't move to bottom cell
-    if (line === lastLine && ch === lastCh && event.keyCode === DOWN_ARROW && event.shiftKey === false) {
-      this.edgeRequested.emit('bottom');
+    if (line === lastLine && ch === lastCh && event.keyCode === DOWN_ARROW) {
+      if (!event.shiftKey) {
+        this.edgeRequested.emit('bottom');
+      }
       return;
     }
   }