Skip to content

Commit f65e417

Browse files
committed
refactor: var names
1 parent 363c0be commit f65e417

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src-node/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/project/WorkingSetView.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,26 +1039,26 @@ define(function (require, exports, module) {
10391039
if (dirSplit.length > 3) {
10401040
const rootDirName = dirSplit[0];
10411041
const secondLastSegment = dirSplit[dirSplit.length - 2];
1042-
const fileName = dirSplit[dirSplit.length - 1];
1042+
const lastSeg = dirSplit[dirSplit.length - 1];
10431043

10441044
if (Phoenix.isNativeApp && brackets.platform === "win") {
1045-
// Eg: C:\\long\path\to\file.txt - > C:\\...\to\file.txt
1046-
truncatedPath = `${rootDirName}:${sep}${sep}\u2026${sep}${secondLastSegment}${sep}${fileName}`;
1045+
// Eg: C:\\long\path\to\fileDir - > C:\\...\to\fileDir
1046+
truncatedPath = `${rootDirName}:${sep}${sep}\u2026${sep}${secondLastSegment}${sep}${lastSeg}`;
10471047
} else if (Phoenix.isNativeApp) {
10481048
// an absolute path of the form /abs/path/to/file in linux/mac desktop
1049-
// Eg: /application/path/to/file.txt - > /application/.../to/file.txt
1050-
truncatedPath = `${sep}${rootDirName}${sep}\u2026${sep}${secondLastSegment}${sep}${fileName}`;
1049+
// Eg: /application/path/to/fileDir - > /application/.../to/fileDir
1050+
truncatedPath = `${sep}${rootDirName}${sep}\u2026${sep}${secondLastSegment}${sep}${lastSeg}`;
10511051
} else if (!Phoenix.isNativeApp && !displayDirPath.startsWith('/')){
1052-
// browser fs access path: `folder/file.txt` (no-leading slash) fs access paths- /mnt/paths
1053-
// Eg: opened/folder/path/to/file.txt - > opened/.../to/file.txt (no-leading slash)
1054-
truncatedPath = `${rootDirName}${sep}\u2026${sep}${secondLastSegment}${sep}${fileName}`;
1052+
// browser fs access path: `folder/fileDir` (no-leading slash) fs access paths- /mnt/paths
1053+
// Eg: opened/folder/path/to/fileDir - > opened/.../to/fileDir (no-leading slash)
1054+
truncatedPath = `${rootDirName}${sep}\u2026${sep}${secondLastSegment}${sep}${lastSeg}`;
10551055
} else {
10561056
//this is an internal indexed db backed virtual path. This can only happen if we allow virtual
10571057
// project locations from one project to be opened in another. So just print the trim path
10581058
// path in this case. In future, when we add this support, the get display path fn should be
10591059
// modified to give somethings like what we do for fs access path.
1060-
// Eg: /application/path/to/file.txt - > /application/.../to/file.txt
1061-
truncatedPath = `${sep}${rootDirName}${sep}\u2026${sep}${secondLastSegment}${sep}${fileName}`;
1060+
// Eg: /application/path/to/fileDir - > /application/.../to/fileDir
1061+
truncatedPath = `${sep}${rootDirName}${sep}\u2026${sep}${secondLastSegment}${sep}${lastSeg}`;
10621062
}
10631063
}
10641064

test/spec/WorkingSetView-integ-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ define(function (require, exports, module) {
201201

202202
await awaits(ProjectManager._RENDER_DEBOUNCE_TIME + 50);
203203

204-
expect($("#project-files-container ul input").val()).toBe(fileName);
204+
await awaitsFor(function () {
205+
return $("#project-files-container ul input").val() === fileName;
206+
});
205207
});
206208

207209
it("should show a directory name next to the file name when two files with same names are opened", async function () {

0 commit comments

Comments
 (0)