Show More
@@ -100,23 +100,21 b' var IPython = (function (IPython) {' | |||||
100 | help_index : '', |
|
100 | help_index : '', | |
101 | handler : function (event) { |
|
101 | handler : function (event) { | |
102 | var index = IPython.notebook.get_selected_index(); |
|
102 | var index = IPython.notebook.get_selected_index(); | |
103 | if (index !== null && index !== 0) { |
|
103 | var cell = IPython.notebook.get_cell(index); | |
104 | var cell = IPython.notebook.get_cell(index); |
|
104 | if (cell && cell.at_top() && index !== 0) { | |
105 | if (cell && cell.at_top()) { |
|
105 | event.preventDefault(); | |
106 | event.preventDefault(); |
|
106 | IPython.notebook.command_mode(); | |
107 |
|
|
107 | IPython.notebook.select_prev(); | |
108 |
|
|
108 | IPython.notebook.edit_mode(); | |
109 |
|
|
109 | var cm = IPython.notebook.get_selected_cell().code_mirror; | |
110 | var cm = IPython.notebook.get_selected_cell().code_mirror; |
|
110 | cm.setCursor(cm.lastLine(), 0); | |
111 | cm.setCursor(cm.lastLine(), 0); |
|
111 | return false; | |
112 | return false; |
|
112 | } else if (cell) { | |
113 |
|
|
113 | var cm = cell.code_mirror; | |
114 |
|
|
114 | var cursor = cm.getCursor(); | |
115 |
|
|
115 | cursor.line -= 1; | |
116 |
|
|
116 | cm.setCursor(cursor); | |
117 |
|
|
117 | return false; | |
118 | return false; |
|
|||
119 | } |
|
|||
120 | } |
|
118 | } | |
121 | } |
|
119 | } | |
122 | }, |
|
120 | }, | |
@@ -125,23 +123,21 b' var IPython = (function (IPython) {' | |||||
125 | help_index : '', |
|
123 | help_index : '', | |
126 | handler : function (event) { |
|
124 | handler : function (event) { | |
127 | var index = IPython.notebook.get_selected_index(); |
|
125 | var index = IPython.notebook.get_selected_index(); | |
128 |
|
|
126 | var cell = IPython.notebook.get_cell(index); | |
129 |
|
|
127 | if (cell.at_bottom() && index !== (IPython.notebook.ncells()-1)) { | |
130 | if (cell && cell.at_bottom()) { |
|
128 | event.preventDefault(); | |
131 | event.preventDefault(); |
|
129 | IPython.notebook.command_mode(); | |
132 |
|
|
130 | IPython.notebook.select_next(); | |
133 |
|
|
131 | IPython.notebook.edit_mode(); | |
134 |
|
|
132 | var cm = IPython.notebook.get_selected_cell().code_mirror; | |
135 | var cm = IPython.notebook.get_selected_cell().code_mirror; |
|
133 | cm.setCursor(0, 0); | |
136 |
|
|
134 | return false; | |
137 |
|
|
135 | } else { | |
138 |
|
|
136 | var cm = cell.code_mirror; | |
139 |
|
|
137 | var cursor = cm.getCursor(); | |
140 |
|
|
138 | cursor.line += 1; | |
141 |
|
|
139 | cm.setCursor(cursor); | |
142 |
|
|
140 | return false; | |
143 | return false; |
|
|||
144 | } |
|
|||
145 | } |
|
141 | } | |
146 | } |
|
142 | } | |
147 | }, |
|
143 | }, |
General Comments 0
You need to be logged in to leave comments.
Login now