Skip to content

Commit 53511df

Browse files
committed
202
1 parent ae58e70 commit 53511df

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Change Log
22

3-
## 0.0.1
3+
### 0.0.1
44

55
- Initial release
66

7-
## 0.0.5
7+
### 0.0.5
88

99
- new tree view btns to
1010
+ open settings file

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "save-editors-layout",
33
"displayName": "Save Editors Layout",
44
"description": "save opened editors layout",
5-
"version": "2.0.1",
5+
"version": "2.0.2",
66
"publisher": "ctf0",
77
"repository": "https://github.com/ctf0/vscode-save-editor-layout",
88
"engines": {
@@ -190,9 +190,9 @@
190190
"watch": "npm run esbuild"
191191
},
192192
"devDependencies": {
193-
"@types/node": "^20.9.0",
193+
"@types/node": "^22.5.0",
194194
"@types/vscode": "^1.80.0",
195-
"typescript": "^5.2.2",
196-
"esbuild": "^0.19.5"
195+
"typescript": "^5.5.4",
196+
"esbuild": "^0.23.1"
197197
}
198198
}

src/extension.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export async function activate(context: vscode.ExtensionContext) {
2828
vscode.window.createTreeView(
2929
'layouts_list',
3030
{
31-
treeDataProvider : new TreeProvider(),
32-
showCollapseAll : true,
31+
treeDataProvider: new TreeProvider(),
32+
showCollapseAll: true,
3333
},
3434
);
3535
}
@@ -70,17 +70,17 @@ async function save() {
7070
return;
7171
} else {
7272
found = Object.assign(found, {
73-
documents : sortedSaveList,
74-
layout : editorGroupLayout,
73+
documents: sortedSaveList,
74+
layout: editorGroupLayout,
7575
});
7676

7777
type = 'updated';
7878
}
7979
} else {
8080
list.push({
81-
name : name,
82-
documents : sortedSaveList,
83-
layout : editorGroupLayout,
81+
name: name,
82+
documents: sortedSaveList,
83+
layout: editorGroupLayout,
8484
});
8585
}
8686

@@ -98,9 +98,9 @@ async function save() {
9898
function getSortedSaveList(tabs = null) {
9999
return sortList(tabs || getOpenedTabsWithoutUntitled()).map((tab: vscode.Tab) => ({
100100
// @ts-ignore
101-
fsPath : tab.input.uri.fsPath,
102-
column : tab.group.viewColumn,
103-
pinned : tab.isPinned,
101+
fsPath: tab.input.uri.fsPath,
102+
column: tab.group.viewColumn,
103+
pinned: tab.isPinned,
104104
}));
105105
}
106106

@@ -165,8 +165,8 @@ async function update() {
165165
const index = list.findIndex((e) => e.name == selection);
166166

167167
list[index] = Object.assign(list[index], {
168-
documents : getSortedSaveList(),
169-
layout : await runCommand('vscode.getEditorLayout'),
168+
documents: getSortedSaveList(),
169+
layout: await runCommand('vscode.getEditorLayout'),
170170
});
171171

172172
await saveUserLists(list);
@@ -178,9 +178,9 @@ async function update() {
178178

179179
function openFile(doc) {
180180
return showDocument({
181-
fsPath : doc.fsPath,
182-
column : doc.column,
183-
pinned : doc.pinned || false,
181+
fsPath: doc.fsPath,
182+
column: doc.column,
183+
pinned: doc.pinned || false,
184184
});
185185
}
186186

@@ -251,7 +251,7 @@ async function saveUserLists(list, forceGlobal = false) {
251251

252252
function getOpenedTabs() {
253253
return vscode.window.tabGroups.all
254-
.flatMap((v) => v.tabs)
254+
.flatMap((v: vscode.TabGroup[]) => v.tabs)
255255
.filter((tab: vscode.Tab) => tab.input !== undefined && tab.input instanceof vscode.TabInputText);
256256
}
257257

@@ -262,7 +262,7 @@ function getOpenedTabsWithoutUntitled() {
262262

263263
async function showQuickPick(list, type) {
264264
return vscode.window.showQuickPick(list, {
265-
placeHolder: `chose a group to ${type}`,
265+
placeHolder: `choose a group to ${type}`,
266266
});
267267
}
268268

@@ -281,9 +281,9 @@ async function showDocument(doc) {
281281
const document = await vscode.workspace.openTextDocument(doc.fsPath);
282282

283283
await vscode.window.showTextDocument(document, {
284-
viewColumn : doc.column,
285-
preserveFocus : false,
286-
preview : false,
284+
viewColumn: doc.column,
285+
preserveFocus: false,
286+
preview: false,
287287
});
288288

289289
if (doc.pinned) {

0 commit comments

Comments
 (0)