Skip to content

Commit fc450f0

Browse files
committed
bug fix
1 parent e623ac7 commit fc450f0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ All notable changes to the *Haskell Runner 2* will be documented in this file.
66

77
- nil
88

9-
## [0.4.0] (not yet released)
9+
## [0.4.0] (Ureleased)
1010

1111
- avoid reusing recovered terminal at startup by keeping track of active terminals created by Haskell Runner 2
1212
- `Stack Run` button can now be hot loaded, but disabling still requires reload

src/extension.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as util from './util';
99
var config: conf.Config = conf.getConfig();
1010
// map of saved terminals of current session
1111
var terminal: Map<string, vscode.Terminal> = new Map();
12+
// stack run button already initialized
13+
var stackRunBtn: boolean = false;
1214

1315
// I'm not sure if we can do `async` here
1416
export async function activate(context: vscode.ExtensionContext) {
@@ -19,11 +21,13 @@ export async function activate(context: vscode.ExtensionContext) {
1921
// update config
2022
vscode.workspace.onDidChangeConfiguration(e => {
2123
config = conf.getConfig();
22-
if (config.showRun) {
24+
if (config.showRun && !stackRunBtn) {
2325
switch (project) {
2426
case 'stack':
27+
stackRunBtn = true;
2528
return util.resgisterStatButton(context, "Stack Run", "runner2.hsrun");
2629
case 'cabal':
30+
stackRunBtn = true;
2731
return util.resgisterStatButton(context, "Cabal Run", "runner2.hsrun");
2832
default: return;
2933
}
@@ -40,7 +44,6 @@ export async function activate(context: vscode.ExtensionContext) {
4044
// currently at GHCi
4145
const term = util.getTermOption(terminal, "GHCi")
4246
.map(term => () => {
43-
console.log(term.exitStatus, term.state);
4447
if (inproject) {
4548
term.sendText(":r"); // reload modules in project
4649
} else {
@@ -95,6 +98,7 @@ export async function activate(context: vscode.ExtensionContext) {
9598
util.resgisterStatButton(context, project + " Build", "runner2.hsbuild");
9699
util.resgisterStatButton(context, project + " Test", "runner2.hstest");
97100
if (config.showRun) {
101+
stackRunBtn = true;
98102
util.resgisterStatButton(context, project + " Run", "runner2.hsrun");
99103
}
100104
};

0 commit comments

Comments
 (0)