Skip to content

Commit

Permalink
- Changed: The ordering behavior inside the pinned folders will be sa…
Browse files Browse the repository at this point in the history
…me as VSCode explorer view. (Fixed Issue #9)
  • Loading branch information
SaekiRaku committed Sep 17, 2020
1 parent 5482723 commit 2ef4890
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the "vscode-pin-up" extension will be documented in this file.

## [1.3.3] - 2020-09-17

- Changed: The ordering behavior inside the pinned folders will be same as VSCode explorer view. (Fixed Issue #9)

## [1.3.2] - 2020-09-13

- Added: An new configuration `pin-up.confirm.removePin(boolean)` that indicate if display a confirm modal before remove or clear the pins.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "pin-up",
"displayName": "📌 Pin Up",
"description": "Pin up files and folders that frequently opened in your project.",
"version": "1.3.2",
"version": "1.3.3",
"engines": {
"vscode": "^1.44.0"
},
Expand Down
8 changes: 8 additions & 0 deletions src/PinDataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ class PinDataProvider {
});
} else {
let dirs = fs.readdirSync(utils.fixedPath(element.uri.path), { withFileTypes: true });
dirs.sort((a, b) => {
if (a.isDirectory() && !b.isDirectory()) {
return -1;
} else if (!a.isDirectory() && b.isDirectory()) {
return 1;
}
return 0;
})
return dirs.map(fileItem => {
let filepath = path.resolve(utils.fixedPath(element.uri.path), fileItem.name)
let isDir = fileItem.isDirectory();
Expand Down

0 comments on commit 2ef4890

Please sign in to comment.