From 3138781fa877532563b65c67de98ea179a4eaccd Mon Sep 17 00:00:00 2001 From: Junv Zhao Date: Tue, 22 Aug 2017 17:14:24 +0800 Subject: [PATCH] Fix the issue of showing some files outside the workspace. --- README.md | 2 ++ extension.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a66ca8..aafc590 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ { "key": "ctrl+e", "command": "workbench.action.openRecent" } ``` +## Notice + * We don't list the files outside the workspace. ## How to use * press `cmd` + `e` (`ctrl` + `e` in Windows) * press `F1` then type `Open Recent Files` diff --git a/extension.js b/extension.js index a2b80f6..10028ef 100644 --- a/extension.js +++ b/extension.js @@ -59,7 +59,9 @@ function handleUserInput(item) { } function mapUriToDisplayName() { - return _.chain(list.slice()).uniq().reverse().map((item) => { + return _.chain(list.slice()).uniq().reverse().remove(item => { + return item.split(vscode.workspace.rootPath).length != 1 + }).map((item) => { return item.substring(vscode.workspace.rootPath.length + 1) }).filter((item) => { //ignore the system files which starts with .