##// END OF EJS Templates
Fixed off by one error in get_prev_cell...
Doug Blank -
Show More
@@ -465,11 +465,9 b' define(['
465 * @return {Cell} The previous cell
465 * @return {Cell} The previous cell
466 */
466 */
467 Notebook.prototype.get_prev_cell = function (cell) {
467 Notebook.prototype.get_prev_cell = function (cell) {
468 // TODO: off-by-one
469 // nb.get_prev_cell(nb.get_cell(1)) is null
470 var result = null;
468 var result = null;
471 var index = this.find_cell_index(cell);
469 var index = this.find_cell_index(cell);
472 if (index !== null && index > 1) {
470 if (index !== null && index > 0) {
473 result = this.get_cell(index-1);
471 result = this.get_cell(index-1);
474 }
472 }
475 return result;
473 return result;
General Comments 0
You need to be logged in to leave comments. Login now