diff --git a/IPython/html/static/notebook/js/cell.js b/IPython/html/static/notebook/js/cell.js index 344adcd..42098aa 100644 --- a/IPython/html/static/notebook/js/cell.js +++ b/IPython/html/static/notebook/js/cell.js @@ -283,9 +283,8 @@ var IPython = (function (IPython) { var cursor = cm.getCursor(); if (cursor.line === 0 && cursor.ch === 0) { return true; - } else { - return false; } + return false; }; /** @@ -297,10 +296,10 @@ var IPython = (function (IPython) { var cursor = cm.getCursor(); if (cursor.line === (cm.lineCount()-1) && cursor.ch === cm.getLine(cursor.line).length) { return true; - } else { - return false; } + return false; }; + /** * enter the command mode for the cell * @method command_mode diff --git a/IPython/html/static/notebook/js/keyboardmanager.js b/IPython/html/static/notebook/js/keyboardmanager.js index 73e5198..0ccb705 100644 --- a/IPython/html/static/notebook/js/keyboardmanager.js +++ b/IPython/html/static/notebook/js/keyboardmanager.js @@ -108,8 +108,7 @@ var IPython = (function (IPython) { IPython.notebook.select_prev(); IPython.notebook.edit_mode(); var cm = IPython.notebook.get_selected_cell().code_mirror; - var prev_cursor = cell.code_mirror.getCursor(); - cm.setCursor(cm.lastLine(), prev_cursor.ch) + cm.setCursor(cm.lastLine(), 0); return false; } else if (cell) { var cm = cell.code_mirror; @@ -134,8 +133,7 @@ var IPython = (function (IPython) { IPython.notebook.select_next(); IPython.notebook.edit_mode(); var cm = IPython.notebook.get_selected_cell().code_mirror; - var prev_cursor = cell.code_mirror.getCursor(); - cm.setCursor(0, prev_cursor.ch); + cm.setCursor(0, 0); return false; } else if (cell) { var cm = cell.code_mirror;