File tree Expand file tree Collapse file tree 3 files changed +12
-18
lines changed
frontend/src/lib/components Expand file tree Collapse file tree 3 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 367
367
}
368
368
}
369
369
370
- function updateCode(): boolean {
370
+ function updateCode() {
371
371
const ncode = getCode ()
372
372
if (code == ncode ) {
373
- return false
373
+ return
374
374
}
375
375
code = ncode
376
- return true
376
+ dispatch ( ' change ' , ncode )
377
377
}
378
378
379
379
export function append(code : string ): void {
1287
1287
editor ?.onDidChangeModelContent ((event ) => {
1288
1288
timeoutModel && clearTimeout (timeoutModel )
1289
1289
timeoutModel = setTimeout (() => {
1290
- if (updateCode ()) {
1291
- dispatch (' change' , code )
1292
- }
1290
+ updateCode ()
1293
1291
}, changeTimeout )
1294
1292
1295
1293
ataModel && clearTimeout (ataModel )
Original file line number Diff line number Diff line change 163
163
editor ?.setValue (ncode )
164
164
}
165
165
166
- function updateCode(): boolean {
166
+ function updateCode() {
167
167
const ncode = getCode ()
168
168
if (code == ncode ) {
169
- return false
169
+ return
170
170
}
171
171
code = ncode
172
- return true
172
+ dispatch ( ' change ' , ncode )
173
173
}
174
174
175
175
function updatePlaceholderVisibility(value : string ) {
379
379
suggestion = ' '
380
380
timeoutModel && clearTimeout (timeoutModel )
381
381
timeoutModel = setTimeout (() => {
382
- if (updateCode ()) {
383
- dispatch (' change' , { code })
384
- }
382
+ updateCode ()
385
383
}, 200 )
386
384
})
387
385
Original file line number Diff line number Diff line change 472
472
editor .addCommand (KeyMod .CtrlCmd | KeyMod .Shift | KeyCode .Digit7 , function () {})
473
473
})
474
474
475
- function updateCode(): boolean {
475
+ function updateCode() {
476
476
const ncode = getCode ()
477
477
if (code == ncode ) {
478
- return false
478
+ return
479
479
}
480
480
code = ncode
481
- return true
481
+ dispatch ( ' change ' , code )
482
482
}
483
483
484
484
let timeoutModel: NodeJS .Timeout | undefined = undefined
485
485
editor .onDidChangeModelContent ((event ) => {
486
486
timeoutModel && clearTimeout (timeoutModel )
487
487
timeoutModel = setTimeout (() => {
488
- if (updateCode ()) {
489
- dispatch (' change' , { code })
490
- }
488
+ updateCode ()
491
489
}, 200 )
492
490
})
493
491
You can’t perform that action at this time.
0 commit comments