Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

allow converting from sql to markdown with existing hotkey (#8389)

Shahmir Varqha3811dafb20ee
diff --git a/frontend/src/core/codemirror/extensions.ts b/frontend/src/core/codemirror/extensions.ts
index 6bd8f170fa..86fe918c9a 100644
--- a/frontend/src/core/codemirror/extensions.ts
+++ b/frontend/src/core/codemirror/extensions.ts
@@ -29,14 +29,9 @@ export function formatKeymapExtension(hotkeys: HotkeyProvider) {
preventDefault: true,
run: (ev) => {
const currentLanguage = getCurrentLanguageAdapter(ev);
- // Early return if not a supported language
- if (currentLanguage !== "markdown" && currentLanguage !== "python") {
- return false;
- }
-
- // Toggle between markdown and python
const destinationLanguage =
- currentLanguage === "python" ? "markdown" : "python";
+ currentLanguage === "markdown" ? "python" : "markdown";
+
const response = toggleToLanguage(ev, destinationLanguage, {
force: true,
});