From c8d835ef4d4c0226bb408396f35831b2c6ecbcaa Mon Sep 17 00:00:00 2001 From: Abhishek S Lal Date: Thu, 26 Mar 2026 20:10:38 +0530 Subject: [PATCH] fix: re-apply masking in MultiLineEditor and SingleLineEditor after setValue() to preserve CodeMirror marks (#7585) --- packages/bruno-app/src/components/MultiLineEditor/index.js | 4 ++++ packages/bruno-app/src/components/SingleLineEditor/index.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/bruno-app/src/components/MultiLineEditor/index.js b/packages/bruno-app/src/components/MultiLineEditor/index.js index 25f1cf52f..11050c5c0 100644 --- a/packages/bruno-app/src/components/MultiLineEditor/index.js +++ b/packages/bruno-app/src/components/MultiLineEditor/index.js @@ -164,6 +164,10 @@ class MultiLineEditor extends Component { this.cachedValue = nextValue; this.editor.setValue(nextValue); this.editor.setCursor(cursor); + // Re-apply masking after setValue() since it destroys all CodeMirror marks + if (this.maskedEditor && this.maskedEditor.isEnabled()) { + this.maskedEditor.update(); + } } } if (!isEqual(this.props.isSecret, prevProps.isSecret)) { diff --git a/packages/bruno-app/src/components/SingleLineEditor/index.js b/packages/bruno-app/src/components/SingleLineEditor/index.js index ae8e89551..8f2aae9e5 100644 --- a/packages/bruno-app/src/components/SingleLineEditor/index.js +++ b/packages/bruno-app/src/components/SingleLineEditor/index.js @@ -179,6 +179,10 @@ class SingleLineEditor extends Component { this.cachedValue = nextValue; this.editor.setValue(nextValue); this.editor.setCursor(cursor); + // Re-apply masking after setValue() since it destroys all CodeMirror marks + if (this.maskedEditor && this.maskedEditor.isEnabled()) { + this.maskedEditor.update(); + } // Update newline markers after value change if (this.props.showNewlineArrow) {