@@ -22,7 +22,6 @@ export class DOSBox{
2222 let wincommand = 'start/min/wait "" "' + conf . path + '/dosbox/dosbox.exe" -conf "' + conf . dosboxconfuri . fsPath + '" '
2323 if ( doc ) wincommand = 'del/Q T*.* & copy "' + doc . fileName + '" "T.ASM" & ' + wincommand
2424 execSync ( wincommand + boxcommand , { cwd :conf . workpath , shell :'cmd.exe' } )
25- console . log ( wincommand + boxcommand )
2625 }
2726 else {
2827 let linuxcommand = 'dosbox -conf "' + conf . dosboxconfuri . fsPath + '" '
@@ -31,19 +30,17 @@ export class DOSBox{
3130 execSync ( linuxcommand + boxcommand , { cwd :conf . workpath } )
3231
3332 }
34- if ( diag ) this . BOXdiag ( conf , diag )
33+ if ( diag && doc ) this . BOXdiag ( conf , diag , doc )
3534 }
36- private BOXdiag ( conf :Config , diag :landiagnose ) :string {
35+ private BOXdiag ( conf :Config , diag :landiagnose , doc : TextDocument ) :string {
3736 let info :string = ' ' , content :string
38- let turi = window . activeTextEditor ?. document . uri
39- let document = window . activeTextEditor ?. document
40- let texturi :Uri
37+ let document = doc
4138 if ( document ) {
4239 content = document . getText ( )
4340 workspace . fs . readFile ( conf . workloguri ) . then (
4441 ( text ) => {
4542 info = text . toString ( )
46- if ( diag . ErrMsgProcess ( content , info , texturi , conf . MASMorTASM ) == 0 ) {
43+ if ( diag . ErrMsgProcess ( content , info , doc . uri , conf . MASMorTASM ) == 0 ) {
4744 let Errmsgwindow = conf . MASMorTASM + '汇编出错,无法运行/调试'
4845 window . showErrorMessage ( Errmsgwindow ) ;
4946 } } ,
0 commit comments