Skip to content

Commit 543d924

Browse files
committed
🥚 fix status bar
1 parent b120c34 commit 543d924

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

src/ASM/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ export async function activate(context: vscode.ExtensionContext) {
174174
}
175175

176176
if (conf.extConf.emulator === conf.DosEmulatorType.msdos) {
177-
api.msdosPlayer();
177+
const t = api.msdosPlayer();
178+
t.show();
178179
}
179180

180181
const diagnose = diag.process(result, doc, conf.extConf.asmType);

src/ASM/statusBar.ts

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@ import * as conf from '../utils/configuration';
33

44
const bar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
55

6+
const emu = [
7+
conf.DosEmulatorType.jsdos,
8+
conf.DosEmulatorType.dosbox,
9+
conf.DosEmulatorType.dosboxX,
10+
conf.DosEmulatorType.msdos
11+
];
12+
13+
const asm = [
14+
conf.Assembler.MASM,
15+
conf.Assembler.TASM
16+
];
17+
18+
const iterms: string[] = [];
19+
for (const e of emu) {
20+
for (const a of asm) {
21+
if (a === conf.Assembler.TASM && e === conf.DosEmulatorType.msdos) {
22+
continue;
23+
}
24+
iterms.push(e + '\t' + a);
25+
}
26+
}
27+
628
function showStatus() {
729
bar.command = 'masmtasm.updateEmuASM';
830
bar.text = `${conf.extConf.emulator} ${conf.extConf.asmType}`;
@@ -11,32 +33,16 @@ function showStatus() {
1133

1234
async function statusBarCommand() {
1335
const _conf = vscode.workspace.getConfiguration('masmtasm.ASM');
14-
const emu = [
15-
conf.DosEmulatorType.jsdos,
16-
conf.DosEmulatorType.dosbox,
17-
conf.DosEmulatorType.dosboxX
18-
];
36+
1937
if (process.platform === 'win32') {
2038
emu.push(conf.DosEmulatorType.msdos);
2139
}
2240

23-
const asm = [
24-
conf.Assembler.MASM,
25-
conf.Assembler.TASM
26-
];
27-
28-
const iterms = [];
29-
for (const e of emu) {
30-
for (const a of asm) {
31-
iterms.push(e + ' ' + a);
32-
}
33-
}
34-
3541
const placeHolder = 'choose DOS environment emulator and assembler';
3642
const Selected = await vscode.window.showQuickPick(iterms, { placeHolder });
3743
if (Selected) {
38-
const [emu1, asm1] = Selected?.split(' ');
39-
const target = vscode.ConfigurationTarget.Workspace;
44+
const [emu1, asm1] = Selected?.split('\t');
45+
const target = vscode.ConfigurationTarget.Global;
4046
await _conf.update('emulator', emu1, target);
4147
await _conf.update('assembler', asm1, target);
4248
showStatus();

0 commit comments

Comments
 (0)