Permalink
Browse files

Ctrl-Enter now does not delete input, but selects it.

  • Loading branch information...
1 parent 88bc8b6 commit c586fb097455abcfeaaccbca96f7023ad35ec880 @ellisonbg committed Aug 24, 2011
@@ -190,6 +190,15 @@ var IPython = (function (IPython) {
};
+ CodeCell.prototype.select_all = function () {
+ var start = {line: 0, ch: 0};
+ var nlines = this.code_mirror.lineCount();
+ var last_line = this.code_mirror.getLine(nlines-1);
+ var end = {line: nlines-1, ch: last_line.length};
+ this.code_mirror.setSelection(start, end);
+ };
+
+
CodeCell.prototype.append_output = function (json) {
this.expand();
if (json.output_type === 'pyout') {
@@ -776,7 +776,7 @@ var IPython = (function (IPython) {
cell.render();
}
if (default_options.terminal) {
- cell.clear_input();
+ cell.select_all();
} else {
if ((cell_index === (that.ncells()-1)) && default_options.add_new) {
that.insert_code_cell_below();

0 comments on commit c586fb0

Please sign in to comment.