Skip to content

Commit 945c3b9

Browse files
committed
fix #5179 -- Inconsistency with cocalc and Jupyter notebook with cell magics and ?
- fixed by making it so we never show introspection panel when *running* a cell; only show it when introspecting with tab key. This matches what jupyterlab does anyways.
1 parent 596e1cf commit 945c3b9

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

src/packages/frontend/jupyter/browser-actions.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -174,25 +174,14 @@ export class JupyterActions extends JupyterActions0 {
174174
const cell_type = cell.get("cell_type", "code");
175175
if (cell_type == "code") {
176176
const code = this.get_cell_input(id).trim();
177-
const cm_mode = this.store.getIn(["cm_options", "mode", "name"]);
178-
const language = this.store.get_kernel_language();
179-
switch (parsing.run_mode(code, cm_mode, language)) {
180-
case "show_source":
181-
this.introspect(code.slice(0, code.length - 2), 1);
182-
break;
183-
case "show_doc":
184-
this.introspect(code.slice(0, code.length - 1), 0);
185-
break;
186-
case "empty":
187-
this.clear_cell(id, save);
188-
break;
189-
case "execute":
190-
this.run_code_cell(id, save, no_halt);
191-
break;
177+
if (!code) {
178+
this.clear_cell(id, save);
179+
return;
180+
}
181+
this.run_code_cell(id, save, no_halt);
182+
if (save) {
183+
this.save_asap();
192184
}
193-
}
194-
if (save) {
195-
this.save_asap();
196185
}
197186
}
198187

0 commit comments

Comments
 (0)