Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: codemirror instance disappearing often

liyasthomasa0a26afd9031
diff --git a/packages/hoppscotch-app/helpers/editor/codemirror.ts b/packages/hoppscotch-app/helpers/editor/codemirror.ts
index caac52e61..772774a02 100644
--- a/packages/hoppscotch-app/helpers/editor/codemirror.ts
+++ b/packages/hoppscotch-app/helpers/editor/codemirror.ts
@@ -259,7 +259,8 @@ export function useCodemirror(
watch(el, () => {
if (el.value) {
- if (!view.value) initView(el.value)
+ if (view.value) view.value.destroy()
+ initView(el.value)
} else {
view.value?.destroy()
view.value = undefined