fix: autosave (#6392)

* fix: autosave

* rm: console
This commit is contained in:
Pooja
2025-12-23 19:21:56 +05:30
committed by GitHub
parent d93d1eacdb
commit ce33cee03d
6 changed files with 28 additions and 1 deletions

View File

@@ -169,8 +169,10 @@ class SingleLineEditor extends Component {
this.editor.setOption('theme', this.props.theme === 'dark' ? 'monokai' : 'default');
}
if (this.props.value !== prevProps.value && this.props.value !== this.cachedValue && this.editor) {
const cursor = this.editor.getCursor();
this.cachedValue = String(this.props.value);
this.editor.setValue(String(this.props.value ?? ''));
this.editor.setCursor(cursor);
// Update newline markers after value change
if (this.props.showNewlineArrow) {