@@ -12,8 +12,10 @@ import {
12
12
CLEAR_REPL_INPUT ,
13
13
CLEAR_REPL_OUTPUT ,
14
14
END_INTERRUPT_EXECUTION ,
15
+ EVAL_EDITOR ,
15
16
EVAL_INTERPRETER_ERROR ,
16
17
EVAL_INTERPRETER_SUCCESS ,
18
+ EVAL_REPL ,
17
19
HANDLE_CONSOLE_LOG ,
18
20
IAction ,
19
21
RESET_ASSESSMENT_WORKSPACE ,
@@ -34,7 +36,8 @@ import {
34
36
defaultWorkspaceManager ,
35
37
externalLibraries ,
36
38
InterpreterOutput ,
37
- IWorkspaceManagerState
39
+ IWorkspaceManagerState ,
40
+ maxBrowseIndex
38
41
} from './states'
39
42
40
43
/**
@@ -257,7 +260,7 @@ export const reducer: Reducer<IWorkspaceManagerState> = (
257
260
} else {
258
261
newReplHistoryRecords = state [ location ] . replHistory . records
259
262
}
260
- if ( newReplHistoryRecords . length > 50 ) {
263
+ if ( newReplHistoryRecords . length > maxBrowseIndex ) {
261
264
newReplHistoryRecords . pop ( )
262
265
}
263
266
return {
@@ -279,14 +282,6 @@ export const reducer: Reducer<IWorkspaceManagerState> = (
279
282
...state [ location ]
280
283
}
281
284
}
282
- case EVAL_REPL :
283
- // Forces re-render of workspace on repl eval
284
- return {
285
- ...state ,
286
- [ location ] : {
287
- ...state [ location ]
288
- }
289
- }
290
285
case EVAL_INTERPRETER_SUCCESS :
291
286
lastOutput = state [ location ] . output . slice ( - 1 ) [ 0 ]
292
287
if ( lastOutput !== undefined && lastOutput . type === 'running' ) {
@@ -336,6 +331,14 @@ export const reducer: Reducer<IWorkspaceManagerState> = (
336
331
* i.e called after the interpreter is told to stop interruption,
337
332
* to cause UI changes.
338
333
*/
334
+ case EVAL_REPL :
335
+ // Forces re-render of workspace on repl eval
336
+ return {
337
+ ...state ,
338
+ [ location ] : {
339
+ ...state [ location ]
340
+ }
341
+ }
339
342
case END_INTERRUPT_EXECUTION :
340
343
/**
341
344
* Set the isRunning property of the
0 commit comments