Commit Graph

4 Commits

Author SHA1 Message Date
liferooter
44f07f7708 texthistory: fix has_actionable function 2021-06-01 11:04:55 +00:00
Matthias Clasen
4d45c2669c text history: Update state when enabled changes
This makes can-undo go FALSE when we disable the
text history, as it should.
2020-09-06 17:02:00 -04:00
Björn Daase
6315cd977c *: Fix spelling mistakes found by codespell 2020-08-21 15:29:34 +02:00
Christian Hergert
5e341210a1 texthistory: add GtkTextHistory helper
The GtkTextHistory helper provides the fundamental undo/redo stack that
can be integrated with other text widgets. It allows coalescing related
actions to reduce both the number of undo actions to the user as well as
the memory overhead.

A new istring helper is used by GtkTextHistory to allow for "inline
strings" that gracefully grow to using allocations with g_realloc(). This
ensure that most undo operations require no additional allocations other
than the struct for the action itself.

A queue of undoable and redoable actions are maintained and the link for
the queue is embedded in the undo action union. This allows again, for
reducing the number of allocations involved for undo operations.
2019-11-05 09:34:29 -08:00