Skip to content

Commit

Permalink
Run selected text if available instead of complete exercise code
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Apr 14, 2021
1 parent 2f2ba2f commit f2a4415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inst/lib/tutorial/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ Tutorial.prototype.$initializeExerciseEvaluation = function() {

// get the code from the editor
var editor = ace.edit($(el).attr('id'));
value.code = editor.getSession().getValue();
value.code = editor.getSelectedText() || editor.getSession().getValue();

// restore flag
value.restore = this.restore;
Expand Down

0 comments on commit f2a4415

Please sign in to comment.