Skip to content

Commit afae9d4

Browse files
committed
Record new item in file history
1 parent f4d94f7 commit afae9d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

quickinput-sample/src/promptCommandWithHistory.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ async function pickCommand() {
6767
if (item instanceof HistoryItem) {
6868
resolve(item.label);
6969
input.hide();
70+
// do not record new input in history
7071
} else if (item instanceof InputItem) {
71-
// record new input in history
7272
resolve(item.label);
7373
input.hide();
74+
// record new input in history
75+
fs.appendFile(historyPath, item.label + '\n', function (err) {
76+
if (err) console.error('Problem while updating history file', err);
77+
});
7478
}
7579
}),
7680
input.onDidHide(() => {

0 commit comments

Comments
 (0)