Fix the bugs of sometimes there are some blank entries.

This commit is contained in:
2017-06-19 15:29:36 +08:00
parent 01067aaad4
commit f17c7570ad
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -61,6 +61,8 @@ function handleUserInput(item) {
function mapUriToDisplayName() {
return _.chain(list.slice()).uniq().reverse().map((item) => {
return item.substring(vscode.workspace.rootPath.length + 1)
}).filter((item) => {
return !!item && (item.trim() !== "")
}).value();
}
@@ -78,13 +80,12 @@ function handleChangeActiveWindow(e) {
if (!uri || uri.trim() === '') return
//only allow to show 20 files.
if (list.length === 20) list = _.tail(list);
if (isFileNameExist(uri)) _.remove(list, (item) => { return item === uri });
if (isFileNameExist(uri)) _.remove(list, (item) => {
return item === uri
});
if (!!buffer) list.push(buffer);
buffer = uri; //update buffer
list = _.uniq(list);
list = _.filter(list, (item) => {
return !!item && (item.trim() !== "")
})
}
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "recent-files",
"displayName": "Open Recent Files",
"description": "Open recent files like you do in Intellij idea.",
"version": "1.1.0",
"version": "1.1.1",
"icon": "logo.png",
"publisher": "junv",
"engines": {