All articles
Inside Textend7 min read

Why one action needs one undo

Dependable undo restores text, structure, and editing position together. How Textend groups complete actions, distinguishes editing history from proposal reversal, and retains actual earlier versions.

A continuous paper ribbon loops back to an aligned stack of pages.

Reverse the action the writer made

One revision can change text, hierarchy, empty paragraphs, and the caret position. For the writer, those changes form one result. Undo should reverse that result coherently and return the draft to an editable state before the action.

Restoring words without their list hierarchy, or leaving the caret at content that no longer exists, makes the writer repair an intermediate state. That weakens undo as a revision tool. Textend considers related text changes and editing positions together when organizing history.

Textend centers direct editing of formatted content. The editor handles structural markers and necessary source adjustments, and organizes undo around visible actions. Reversing an action should not require studying how many Markdown lines changed internally.

An action is not necessarily a single keystroke

Continuous typing can form a coherent group that undo reverses together. Pasting, structural commands, and accepting AI changes have their own intent boundaries. Splitting everything by keystroke makes a sentence tedious to reverse; combining unrelated intentions can make undoing a paste also remove earlier typing.

Textend records changes in editing history, with operation types and transaction boundaries supplied by the relevant commands. Its current grouping can combine continuous typing while keeping a subsequent paste separate. AI acceptance also enters the body as an explicit edit. A single confirmation that changes several places need not require several reversals.

“One action, one undo” refers to meaningful editing boundaries. It does not promise a separate history entry for each character or click. Grouping should make reversal match the writer’s understanding of the preceding work.

Restore structure, empty paragraphs, and selection with the text

Changing list depth, replacing text across lines, or pasting nested content can adjust parent markers, descendant indentation, and paragraph separation as well as words. When one action requires those changes, reversal needs to restore them together rather than leave a partly restored hierarchy.

Empty paragraphs have the same requirement. Textend distinguishes visible editable empty paragraphs from Markdown blank lines that separate structure. Normalization needed in an edited area shares the edit’s transaction. Undo and redo do not run normalization again and alter the state just restored.

Selection and caret state determine where writing resumes. History records selection state alongside text changes, and structural commands must leave valid restored positions. The aim is agreement between words, visible hierarchy, and the next input location, beyond merely recovering a string.

Accepting AI changes is an explicit editing decision

An AI candidate still awaits the writer’s judgment. Textend’s in-place diff preview shows the change; accepting it writes the replacement into the current body. That acceptance can be undone, allowing another reading in full context before deciding whether to keep the result.

A multi-operation proposal may affect several passages or structures. The current product presents it as one complete confirmation unit: comparisons explain the changes, and application commits the proposal together. Writers do not need to assemble intermediate versions to reach its final result.

Reversing a proposal also requires coherence. The relevant path first plans the reversals and writes them only when they can all be completed safely. If one change can no longer be located reliably, it does not reverse the others first and leave a partially executed result.

Editing history and proposal reversal have different scopes

The editor’s undo moves backward through editing history. Manual edits after an AI acceptance are normally reversed before the acceptance itself. Redo restores the corresponding history forward. This serves a recent sequence of editing decisions, with order providing the basis.

Undo on a proposal card targets the changes made by that proposal. Textend retains evidence from before and after application. If the body still matches the applied result, it can restore directly. If unrelated editing has occurred elsewhere, the relevant path attempts to locate the changes uniquely and reverse only the proposal while retaining other content.

This is conditional, targeted reversal. If the target was subsequently rewritten, its location is ambiguous, or all changes cannot be reversed safely, proposal undo stops and explains why. Later writing needs protection too; reversing an older proposal cannot justify guessing a location and overwriting the current draft.

Restoring the body does not rerun AI

Undo uses edits that actually occurred and retained evidence of those changes. It does not ask a model to reconstruct the original sentence. A fresh AI request creates a new candidate from current input. Even a request to “restore the previous version” cannot replace an actual record of the original.

Body history and temporary previews have distinct lifecycles. Accepting an in-place diff in Textend consumes that preview. Undoing the text does not establish that the preview will reappear or has checked the current context again. A new candidate should be requested against the current draft.

Discussion proposals have their own application state and undo evidence, with availability reassessed under those rules after reversal. They differ from a consumed in-place preview. Separating body restoration, preview display, proposal state, and model generation keeps reversal controls meaningful.

Undo, version history, and new candidates serve different needs

Undo works with the editing process. Version history provides actual retained drafts. AI regeneration explores new wording. All support revision, but they rely on different evidence and cannot substitute for one another.

Textend’s library documents offer version history: preview an earlier draft, compare changes, and decide whether to restore it. You can also create a current version at a milestone and give it a name. External Markdown files do not expose the same library-history entry and need separate versions or backups.

Ordinary saving establishes the current body on disk. Version history concerns which earlier stages remain available. A save does not create a permanent history node for every edit, and an undo stack is not a complete backup. Keep actual versions for delivery drafts and milestones that need long-term retention.

NeedAppropriate toolBasis
Reverse recent editing decisionsEditor undo / redoRecorded text changes and corresponding editing state.
Inspect or restore an earlier library draftLibrary version historyRetained versions; preview before deciding to restore.
Keep the draft and explore different wordingRequest AI against the current textA newly generated candidate, not an exact record of earlier text.

Writing and source modes share document history

Textend uses Markdown text as the body, with writing and source modes operating in the same editor state. Switching modes changes presentation and editing behavior. It neither creates a second body nor counts the switch itself as a text edit.

Writers can stay with visible content and open source only when they need precise access to marks. Undo across modes concerns actual text edits, with words and hierarchy reflected in writing mode. Maintaining history does not require reconciling two document bodies.

Shared history does not require every key to perform the same action in both modes. Deleting a source character and removing a visible structure have different semantics. Undo needs to reverse the operation actually performed rather than force both interfaces into one command model.

Dependable reversal makes revision easier to explore

Revision involves trying a different hierarchy or wording, accepting advice, and changing one’s mind. Clear reversal boundaries let the writer judge whether a change helps without worrying about recovering the original. Textend treats undo as a core editing capability, giving structural actions and AI collaboration understandable return paths.

That reliability comes from specific work: committing related changes together, restoring caret and selection with history, grounding targeted reversal in recorded text, and protecting current content when conflicts arise. Alongside actual saved versions, it supports reversing recent decisions and retaining drafts worth returning to later.