Skip to content

Commit 7b5bd66

Browse files
authored
Merge pull request #3175 from gnestor/issue-2591
Add Jupyter action for CodeMirror indentAuto command
2 parents 27c00bf + 630ef63 commit 7b5bd66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

notebook/static/notebook/js/actions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,16 @@ define([
685685
}
686686
}
687687
},
688+
'auto-indent': {
689+
cmd: i18n.msg._('automatically indent selection'),
690+
help : i18n.msg._('automatically indent selection'),
691+
handler : function(env) {
692+
// Get selected cell
693+
var selected_cell = env.notebook.get_selected_cell();
694+
// Execute a CM command
695+
selected_cell.code_mirror.execCommand('indentAuto');
696+
}
697+
}
688698
};
689699

690700
/**

0 commit comments

Comments
 (0)