public sealed class TextEditCommandOne run of typing, as an undo entry.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The whole text, before and after. A structural edit — an insert with its position and length — is what a text editor's own undo stack holds, and it is the right shape when the stack belongs to the editor. This stack belongs to the document, alongside the command that renamed the asset and the one that changed its import settings, so an entry has to be replayable against a buffer that something else may have touched. A snapshot is; an offset is not.
The cost is the file's size per undo entry, which for source files is kilobytes. That is the trade this makes deliberately, and it is why TryMergeWith is where the entry count is actually controlled.
Fields and properties (2)
public string AfterThe text this entry leaves behind.
public string NameWhat this is called in the undo history, as a person would say it.
Methods (4)
public TextEditCommand(CodeDocument document, string before, string after)Describes one run of typing.
public void Do(EditorContext context)Applies the change.
public void Undo(EditorContext context)Puts back exactly what Do changed.
public bool TryMergeWith(IEditorCommand previous, out IEditorCommand? merged)
Used by (1)
- CodeDocumentVixen.Editor.AssetEditors