diff --git a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx index 4b05881848d..5c201b4b0d9 100644 --- a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx @@ -15,6 +15,7 @@ import { Admonition } from 'ui-patterns' import { untitledSnippetTitle } from './SQLEditor.constants' import type { IStandaloneCodeEditor } from './SQLEditor.types' import { createSqlSnippetSkeletonV2 } from './SQLEditor.utils' +import { makeActiveTabPermanent } from 'state/tabs' export type MonacoEditorProps = { id: string @@ -120,6 +121,9 @@ const MonacoEditor = ({ }, 1000) function handleEditorChange(value: string | undefined) { + // make active tab permanent + makeActiveTabPermanent(ref) + const snippetCheck = snapV2.snippets[id] if (id && value) { diff --git a/apps/studio/components/layouts/tabs/new-tab.tsx b/apps/studio/components/layouts/tabs/new-tab.tsx index 7d8d0be4a57..a2569f26802 100644 --- a/apps/studio/components/layouts/tabs/new-tab.tsx +++ b/apps/studio/components/layouts/tabs/new-tab.tsx @@ -59,7 +59,7 @@ export function NewTab() { return (