File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ async function listener(event, overrides = {}) {
9797 return ;
9898
9999 if ( isVim )
100- await vim ( char , event ) ;
100+ vim ( char , event ) ;
101101}
102102
103103function getSymbol ( shift , keyCode ) {
Original file line number Diff line number Diff line change @@ -9,30 +9,31 @@ const {
99 selectFileNotParent,
1010} = require ( './set-current' ) ;
1111
12- const { DOM = { } , CloudCmd = { } ,
13- } = globalThis ;
14-
15- const { Dialog = { } } = DOM ;
16-
17- const DEPS = {
18- ... DOM ,
19- ...CloudCmd ,
20- } ;
21-
22- module . exports = async ( key , event , deps = DEPS ) => {
12+ module . exports = ( key , event , overrides = { } ) => {
13+ const defaults = {
14+ ... globalThis . DOM ,
15+ ... globalThis . CloudCmd ,
16+ } ;
17+
18+ const deps = {
19+ ...defaults ,
20+ ... overrides ,
21+ } ;
22+
2323 const operations = getOperations ( event , deps ) ;
24- await vim ( key , operations , deps ) ;
24+ vim ( key , operations , deps ) ;
2525} ;
2626
2727const getOperations = ( event , deps ) => {
2828 const {
29- Info = DOM . CurrentInfo ,
29+ Info = globalThis . DOM . CurrentInfo ,
30+ CloudCmd = globalThis . CloudCmd ,
3031 Operation,
3132 unselectFiles,
3233 setCurrentFile,
3334 setCurrentByName,
3435 getCurrentName,
35- prompt = Dialog . prompt ,
36+ prompt = globalThis . DOM . Dialog . prompt ,
3637 preventDefault = event ?. preventDefault ?. bind ( event ) ,
3738
3839 toggleSelectedFile,
Original file line number Diff line number Diff line change @@ -644,19 +644,21 @@ test('cloudcmd: client: key: make file', (t) => {
644644 t . end ( ) ;
645645} ) ;
646646
647- test . skip ( 'cloudcmd: client: vim: terminal' , ( t ) => {
648- const { CloudCmd} = globalThis ;
649-
650- assign ( CloudCmd , {
647+ test ( 'cloudcmd: client: vim: terminal' , ( t ) => {
648+ const CloudCmd = {
651649 Terminal : {
652650 show : stub ( ) ,
653651 } ,
654- } ) ;
652+ } ;
655653
656654 const event = { } ;
657655
658- vim ( 't' , event ) ;
659- vim ( 't' , event ) ;
656+ vim ( 't' , event , {
657+ CloudCmd,
658+ } ) ;
659+ vim ( 't' , event , {
660+ CloudCmd,
661+ } ) ;
660662
661663 t . calledWithNoArgs ( CloudCmd . Terminal . show ) ;
662664 t . end ( ) ;
You can’t perform that action at this time.
0 commit comments