Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

docs: Add project panel's undo and redo documentation (#60191)

Dino95106f9cde3a
diff --git a/docs/src/project-panel.md b/docs/src/project-panel.md
index 030177af8f6..d94954bb4b3 100644
--- a/docs/src/project-panel.md
+++ b/docs/src/project-panel.md
@@ -185,3 +185,63 @@ The `project_panel.sort_order` setting controls name comparison:
selected directory.
- {#action project_panel::RemoveFromProject} removes a workspace root folder
from the project.
+
+## Undo and Redo
+
+The Project Panel keeps a history of the file operations you perform through it,
+letting you undo ({#action project_panel::Undo} / {#kb project_panel::Undo}) and
+redo ({#action project_panel::Redo} / {#kb project_panel::Redo}) these
+operations, with support for local and remote projects.
+
+The following operations are tracked:
+
+- {#action project_panel::NewFile}
+- {#action project_panel::NewDirectory}
+- {#action project_panel::Rename}
+- {#action project_panel::Trash}
+- {#action project_panel::Paste}
+- {#action project_panel::Duplicate}
+
+Besides these actions, moving items within the panel using drag and drop, as
+well as dragging files into the panel from outside Zed, are also tracked.
+
+Undoing a move or rename (for example {#action project_panel::Rename}, a
+{#action project_panel::Cut} followed by paste, or a drag within the panel)
+returns the item to its original name or location.
+
+Undoing an operation that creates a file or directory (for example
+{#action project_panel::NewFile}, {#action project_panel::NewDirectory},
+{#action project_panel::Duplicate}, a {#action project_panel::Copy} followed by
+paste, or a drag from outside Zed) moves the new item to your system trash
+rather than deleting it. This keeps it recoverable and lets redo restore it, but
+it also means you may notice these items appear in your trash.
+
+When you batch several of these together, for example, selecting multiple files
+and moving them to another folder, the whole batch is undone or redone as a
+single step, and a failure in one of the operations does not block the rest.
+
+### Limitations
+
+- Undo and redo are not available when collaborating in a project shared by
+ someone else. The same applies to {#action project_panel::Trash}, so when
+ working as a guest in a shared project, files can only be permanently
+ deleted, and file operations cannot be undone.
+- Operations whose result is a path excluded from the project via the
+ `file_scan_exclusions` setting are not recorded. For example, with
+ `**/*.secret` excluded, creating a file named `token.secret`, or renaming an
+ existing file to `token.secret`, succeeds on disk, but the operation cannot
+ be undone from the panel.
+- Permanently deleting an item ({#action project_panel::Delete}) is not tracked
+ and cannot be undone.
+- Undoing a {#action project_panel::Trash} restores the item from your system's
+ trash. If you empty the trash, the item can no longer be restored.
+- Undo and redo act on the current state of the filesystem. If something changed
+ outside Zed, for example, a conflicting file now exists at the destination, or
+ the item was moved or deleted by another program, the operation may no longer
+ be undoable, and Zed will show a notification accordingly.
+- On remote hosts without system trash support, {#action project_panel::Trash}
+ will fail when used, along with anything that relies on it, such as undoing a
+ trash or undoing an operation that creates a file or directory. At the time of
+ writing, Zed does not reliably detect trash support ahead of time, so the
+ action is always available but may report an error.
+- The undo history is not persisted across sessions, so quitting Zed clears it.