Skip to content

Commit

Permalink
Merge pull request #770 from jfbercher/patch-2
Browse files Browse the repository at this point in the history
Update code_prettify to address #767
  • Loading branch information
jcb91 committed Oct 18, 2016
2 parents ca8801b + dc12a31 commit 50b4f59
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ define(function(require, exports, module) {
}
}

function yapf_format(index) {
//var selected_cell = Jupyter.notebook.get_selected_cell();
index = index;
Jupyter.notebook.select(index);
function yapf_format() {
var selected_cell = Jupyter.notebook.get_selected_cell();
if (selected_cell instanceof CodeCell) {
var text = selected_cell.get_text()
Expand All @@ -137,7 +134,7 @@ define(function(require, exports, module) {
.replace(/([^\\])\\\\\\n/g, "$1") // [continuation line] replace \ at eol (but result will be on a single line)
var code_input = 'FormatCode(' + text + ')[0]'
//console.log("INPUT",code_input)
exec_code(code_input, index)
exec_code(code_input)
}
}

Expand Down

0 comments on commit 50b4f59

Please sign in to comment.