File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ async function pickCommand() {
4343 input . placeholder = 'Type a command' ;
4444 input . items = commandsItems ;
4545
46-
4746 const updateQuickPick = value => {
4847 if ( ! value ) {
4948 input . items = commandsItems ;
@@ -72,9 +71,11 @@ async function pickCommand() {
7271 resolve ( item . label ) ;
7372 input . hide ( ) ;
7473 // 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- } ) ;
74+ if ( historyShouldBeUpdated && ! item . label . startsWith ( ' ' ) ) {
75+ fs . appendFile ( historyPath , item . label + '\n' , function ( err ) {
76+ if ( err ) console . error ( 'Problem while updating history file' , err ) ;
77+ } ) ;
78+ }
7879 }
7980 } ) ,
8081 input . onDidHide ( ( ) => {
@@ -95,7 +96,8 @@ async function pickCommand() {
9596 updateQuickPick ( currentValue ) ;
9697 } ) ;
9798 } else {
98- console . log ( 'history file does not exist yet' )
99+ console . log ( 'history file does not exist yet' ) ;
100+ historyShouldBeUpdated = true ;
99101 }
100102
101103 } ) ;
You can’t perform that action at this time.
0 commit comments