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