|
Gin
|
Undo/redo history management for text editing with efficient diff-based storage. More...
#include <gin_texthistory.h>
Public Member Functions | |
| void | setHistoryLimit (int numItems) |
| void | undo () |
| void | redo () |
| bool | canUndo () |
| bool | canRedo () |
| bool | addText (const juce::String &) |
| const juce::String & | getCurrentText () |
Public Attributes | |
| std::function< void()> | onStateChanged |
Undo/redo history management for text editing with efficient diff-based storage.
TextHistory provides unlimited undo/redo functionality for text documents using a diff-based approach (binary patches) for memory-efficient storage. Instead of storing complete text snapshots, only the differences between states are stored.
Key Features:
The implementation uses binary diff patches (forward and backward) to efficiently store changes, making it suitable for large documents or long editing sessions.
Usage:
Implementation Details:
| void TextHistory::undo | ( | ) |
| void TextHistory::redo | ( | ) |
| bool TextHistory::canUndo | ( | ) |
| bool TextHistory::canRedo | ( | ) |
| const juce::String & TextHistory::getCurrentText | ( | ) |
| std::function<void ()> TextHistory::onStateChanged |