mirror of
https://github.com/wahyd4/vscode-plugin-recent-files.git
synced 2026-08-09 04:36:04 +10:00
Fix the bugs of sometimes there are some blank entries.
This commit is contained in:
+5
-4
@@ -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
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user