Skip to content

Commit

Permalink
Make command autocomplete not overwrite what's before it
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderPuppy committed Apr 20, 2012
1 parent b29872d commit ee243eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/autocomplete.js
Expand Up @@ -62,7 +62,9 @@ define(['require', 'exports', './commandParser', './argument'], function(require
}).map(function(file) {
return {
name: ( cmdSplit.length > 1 ? terminal.fs.pathTo(file) : file.name ),
full: ( cmdSplit.length > 1 ? terminal.fs.pathTo(file) : file.name ) + ( cmdName ? cmdLine.substr(cmdName.end) : '' )
full: ( autoCompleteCMD ? cmdLine.substr(0, autoCompleteCMD.begin) : '' ) +
( cmdSplit.length > 1 ? terminal.fs.pathTo(file) : file.name ) +
( cmdName ? cmdLine.substr(cmdName.end) : '' )
};
});
} else {
Expand All @@ -76,7 +78,9 @@ define(['require', 'exports', './commandParser', './argument'], function(require
}).map(function(file) {
return {
name: ( cmdSplit.length > 1 ? terminal.fs.pathTo(file) : file.name ),
full: ( cmdSplit.length > 1 ? terminal.fs.pathTo(file) : file.name ) + ( cmdName ? cmdLine.substr(cmdName.end) : '' )
full: ( autoCompleteCMD ? cmdLine.substr(0, autoCompleteCMD.begin) : '' ) +
( cmdSplit.length > 1 ? terminal.fs.pathTo(file) : file.name ) +
( cmdName ? cmdLine.substr(cmdName.end) : '' )
};
});
}
Expand Down

0 comments on commit ee243eb

Please sign in to comment.