Permalink
Browse files

make ctrl-m ghetto work again

  • Loading branch information...
1 parent 44c59b6 commit b1efc7be04b804262bcc8a3944cb265cad94217a @ivanov committed Dec 3, 2012
Showing with 7 additions and 12 deletions.
  1. +7 −12 IPython/frontend/html/notebook/static/js/notebook.js
@@ -182,16 +182,6 @@ var IPython = (function (IPython) {
// Move cell up = k
that.select_prev();
return false;
- } else if (event.which === 77 && event.ctrlKey) {
- // To markdown = m
- var cell = that.get_selected_cell();
- if ((cell instanceof IPython.CodeCell)) {
- that.to_markdown();
- } else {
- that.to_code();
- }
- that.control_key_active = false;
- return false;
} else if (event.which === 67 && event.ctrlKey) {
// Interrupt kernel with old-school ctrl-c
that.kernel.interrupt();
@@ -254,8 +244,13 @@ var IPython = (function (IPython) {
that.control_key_active = false;
return false;
} else if (event.which === 77 && that.control_key_active) {
- // To markdown = m
- that.to_markdown();
+ // Toggle markdown, code, raw mode = m
+ var cell = that.get_selected_cell();
+ if ((cell instanceof IPython.CodeCell)) {
+ that.to_markdown();
+ } else {
+ that.to_code();
+ }
that.control_key_active = false;
return false;
} else if (event.which === 84 && that.control_key_active) {

0 comments on commit b1efc7b

Please sign in to comment.