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

+2
Переглянути файл
@@ -182,6 +182,8 @@ With tabs placed left or right, the tab column is as wide as its longest name, u
As in IntelliJ IDEA, there is no per-file save: files are saved when you switch to another application or to the built-in terminal, and **File › Save All** (`⌘S` / `Ctrl+S`) saves everything at once. **Settings › Appearance & Behavior › System Settings**, section **Autosave**, can also save after the IDE has been idle for a while.
**File › Save As…** (`⇧⌘S` / `Ctrl+Shift+S`) opens the Copy dialog for the current file. The copy includes unsaved edits; the copy operation itself does not save or retarget the original tab, buffer or file. Choose a destination and optionally select **Open copy in editor** to open the copy in a new active tab.
If you keep typing during a save, edits not included in that write stay marked as unsaved.
Changes made outside the IDE are picked up when you switch back to its window. **Reload from Disk** (`⌥⌘Y` / `Ctrl+Alt+Y`) reloads the current file now.
+1
Переглянути файл
@@ -192,6 +192,7 @@ Some shortcuts depend on where the focus is. For example `⌘N` / `Alt+Insert` i
| --------------------------------- | ------------ | ----------------------- |
| Settings… | `⌘,` | `Ctrl+Alt+S` |
| Project Structure… | `⌘;` | `Ctrl+Alt+Shift+S` |
| Save As… | `⇧⌘S` | `Ctrl+Shift+S` |
| Save All | `⌘S` | `Ctrl+S` |
| New Scratch File… | `⇧⌘N` | `Ctrl+Alt+Shift+Insert` |
| Quick Preview (Project) | `Space` | `Space` |
+2
Переглянути файл
@@ -180,6 +180,8 @@ description: "多光标与选区、行编辑、剪贴板历史、代码折叠、
和 IntelliJ IDEA 一样,这里没有逐个文件保存的概念:切换到其他应用或内置终端时文件会自动保存,**文件 › 全部保存**(`⌘S` / `Ctrl+S`)立即保存所有文件。**设置 › 外观与行为 › 系统设置** 的 **自动保存** 一节还可以设置在 IDE 空闲一段时间后保存。
**文件 › 另存为…**(`⇧⌘S` / `Ctrl+Shift+S`)为当前文件打开“复制”对话框。副本包含未保存的编辑;复制操作本身不会保存或改变原标签页、缓冲区和磁盘文件。选择目标位置,并可勾选**在编辑器中打开副本**,在新的活动标签页中打开副本。
如果在保存期间继续编辑,未写入磁盘的改动仍会标记为未保存。
在 IDE 之外修改的文件,会在切回 IDE 窗口时同步。**从磁盘重新加载**(`⌥⌘Y` / `Ctrl+Alt+Y`)立即重新加载当前文件。
+1
Переглянути файл
@@ -192,6 +192,7 @@ macOS 符号:`⌘` Command、`⌥` Option、`⌃` Control、`⇧` Shift、`↵
| ---------------------- | ------------ | ----------------------- |
| 设置… | `⌘,` | `Ctrl+Alt+S` |
| 项目结构… | `⌘;` | `Ctrl+Alt+Shift+S` |
| 另存为… | `⇧⌘S` | `Ctrl+Shift+S` |
| 全部保存 | `⌘S` | `Ctrl+S` |
| 新建临时文件… | `⇧⌘N` | `Ctrl+Alt+Shift+Insert` |
| 快速预览(项目) | `Space` | `Space` |