File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,17 @@ export const Output = observer(
9191 openerService : this . openerService ( ) ,
9292 } ,
9393 ) ;
94+
95+ this . editor . addCommand (
96+ monaco . KeyMod . CtrlCmd | monaco . KeyCode . KEY_K ,
97+ ( ) => {
98+ this . props . appState . clearConsole ( ) ;
99+ this . props . appState . output . push ( {
100+ timeString : new Date ( ) . toLocaleTimeString ( ) ,
101+ text : '' ,
102+ } ) ;
103+ } ,
104+ ) ;
94105 }
95106 }
96107
Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ export class MonacoMock {
4444 } ,
4545 } ,
4646 } ;
47+ public KeyMod = {
48+ CtrlCmd : jest . fn ( ) ,
49+ } ;
50+ public KeyCode = {
51+ KEY_K : jest . fn ( ) ,
52+ } ;
4753}
4854
4955export class MonacoEditorMock {
@@ -55,6 +61,7 @@ export class MonacoEditorMock {
5561 private model = new MonacoModelMock ( '' , 'javascript' ) ;
5662 private scrollHeight = 0 ;
5763
64+ public addCommand = jest . fn ( ) ;
5865 public dispose = jest . fn ( ) ;
5966 public getAction = jest . fn ( ( ) => this . action ) ;
6067 public getModel = jest . fn ( ( ) => this . model ) ;
You can’t perform that action at this time.
0 commit comments