feat(editor): add Save As for existing files (#6534)

File > Save As opens the existing Copy dialog for the active file with Open copy in editor forced on. A single-file copy of an open editor uses the new doc_copy_as, which writes the current buffer with its encoding, BOM and line endings and refuses a target that is open in another editor.

Co-authored-by: muutot <[email protected]>
Цей коміт міститься в:
Muuтаmuutot authored and GitHub committed 2026-11-29 10:35:25 +08:00
1 джерело 2cce84ad2c
коміт c709844c04
33 files changed
+396 -20

No files matched your search

+1
Переглянути файл
@@ -259,6 +259,7 @@ describe("t / locales", () => {
it("lists keys by prefix", () => {
const keys = keysWithPrefix("menu.");
expect(keys).toContain("menu.file.save");
expect(keys).toContain("menu.file.saveAs");
expect(keys.every((k) => k.startsWith("menu."))).toBe(true);
});
});
+1
Переглянути файл
@@ -103,6 +103,7 @@ export const IDEA_ACTIONS: Readonly<Record<string, string>> = {
"Debugger.RemoveAllBreakpoints": "debug.removeAllBreakpoints",
"Debugger.RemoveAllBreakpointsInFile": "debug.removeAllBreakpointsInFile",
ToggleBreakpointEnabled: "debug.toggleBreakpointEnabled",
SaveAs: "file.saveAs",
SaveAll: "file.save",
ShowSettings: "file.settings",
NewScratchFile: "file.newScratchFile",
+1
Переглянути файл
@@ -152,6 +152,7 @@ describe("IDEA keymap parity", () => {
["workbench.stopBackgroundProcesses", ["Meta+Shift+F2"], ["Ctrl+Shift+F2"]],
["navigate.back", ["Meta+[", "Meta+Alt+Left", "Button4", "SwipeRight"], ["Ctrl+Alt+Left", "Button4"]],
["navigate.forward", ["Meta+]", "Meta+Alt+Right", "Button5", "SwipeLeft"], ["Ctrl+Alt+Right", "Button5"]],
["file.saveAs", ["Meta+Shift+S"], ["Ctrl+Shift+S"]],
["file.projectStructure", ["Meta+;"], ["Ctrl+Alt+Shift+S"]],
["build.compileFile", ["Meta+Shift+F9"], ["Ctrl+Shift+F9"]],
["build.buildModule", [], []],
+1
Переглянути файл
@@ -229,6 +229,7 @@ export const intellijMacos: Record<string, string[]> = {
"refactor.pushMembersDown": [],
// File / editor tabs
"file.saveAs": ["Meta+Shift+S"],
"file.save": ["Meta+S"],
"file.settings": ["Meta+,"],
"file.projectStructure": ["Meta+;"],
+1
Переглянути файл
@@ -230,6 +230,7 @@ export const intellijWindows: Record<string, string[]> = {
"refactor.pushMembersDown": [],
// File / editor tabs
"file.saveAs": ["Ctrl+Shift+S"],
"file.save": ["Ctrl+S"],
"file.settings": ["Ctrl+Alt+S"],
"file.projectStructure": ["Ctrl+Alt+Shift+S"],
+1
Переглянути файл
@@ -223,6 +223,7 @@ export const vscodeMacos: Record<string, string[]> = {
// File / editor tabs
"file.save": ["Meta+S"],
"file.saveAs": ["Meta+Shift+S"],
"file.newUntitled": ["Meta+N"],
"file.new": [],
"file.settings": ["Meta+,"],
+1
Переглянути файл
@@ -236,6 +236,7 @@
"menu.window.previousTab": "Previous Project Tab",
"menu.project.attach": "Attach Project…",
"menu.file.openProject": "Open…",
"menu.file.saveAs": "Save As…",
"menu.file.save": "Save All",
"menu.file.projectStructure": "Project Structure…",
"menu.file.settings": "Settings…",
+1
Переглянути файл
@@ -2790,6 +2790,7 @@
"Save": "儲存",
"Save All": "全部儲存",
"Save As": "另存為",
"Save As…": "另存為…",
"Save Files": "儲存檔案",
"Save files if the IDE is idle for": "IDE 空閒以下時長時儲存檔案",
"Save files when switching to a different application or a built-in terminal": "切換到其他應用程式或內建終端機時儲存檔案",
+1
Переглянути файл
@@ -232,6 +232,7 @@
"menu.window.previousTab": "上一個專案分頁",
"menu.project.attach": "附加專案…",
"menu.file.openProject": "開啟…",
"menu.file.saveAs": "另存為…",
"menu.file.save": "全部儲存",
"menu.file.projectStructure": "專案結構…",
"menu.file.settings": "設定…",
+1
Переглянути файл
@@ -236,6 +236,7 @@
"menu.window.previousTab": "上一个项目标签页",
"menu.project.attach": "附加项目…",
"menu.file.openProject": "打开…",
"menu.file.saveAs": "另存为…",
"menu.file.save": "全部保存",
"menu.file.projectStructure": "项目结构…",
"menu.file.settings": "设置…",