@@ -14,7 +14,6 @@ const EDITOR_OPTS = {
14
14
autoFindInSelection: true ,
15
15
seedSearchStringFromSelection: true ,
16
16
},
17
- formatOnPaste: true ,
18
17
renderControlCharacters: true ,
19
18
renderIndentGuides: true ,
20
19
renderWhitespace: " boundary" ,
@@ -158,13 +157,15 @@ export default {
158
157
return {
159
158
editor: null ,
160
159
ready: ready .then (this .initialize ),
161
- invalidate: debounce (() => {
160
+ editing: false ,
161
+ invalidate_: debounce (() => {
162
162
const editor = this .codeEditor
163
163
if (editor != null ) {
164
164
const model = editor .getModel ()
165
165
const value = model .getValue ()
166
166
this .$emit (" edit" , value)
167
167
}
168
+ this .editing = false
168
169
}, 667 ),
169
170
}
170
171
},
@@ -188,6 +189,14 @@ export default {
188
189
}
189
190
return null
190
191
},
192
+
193
+ actualFixedCode () {
194
+ const editor = this .codeEditor
195
+ if (this .editing && editor != null ) {
196
+ return editor .getModel ().getValue ()
197
+ }
198
+ return this .fixedCode
199
+ },
191
200
},
192
201
193
202
watch: {
@@ -198,7 +207,7 @@ export default {
198
207
}
199
208
},
200
209
201
- fixedCode (value ) {
210
+ actualFixedCode (value ) {
202
211
const editor = this .fixedCodeEditor
203
212
if (editor != null ) {
204
213
updateValue (editor, value)
@@ -273,7 +282,6 @@ export default {
273
282
274
283
// Set change event.
275
284
original .onDidChangeContent (() => {
276
- updateValue (rightEditor, original .getValue ())
277
285
this .invalidate ()
278
286
})
279
287
@@ -286,6 +294,11 @@ export default {
286
294
287
295
return editor
288
296
},
297
+
298
+ invalidate () {
299
+ this .editing = true
300
+ this .invalidate_ ()
301
+ },
289
302
},
290
303
}
291
304
</script >
0 commit comments