Text editor undo system, undo step limiting behavior #68068
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#68068
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently having a linear undo stack has a limitation which is most obvious with text undo.
Typing a character uses a single undo step, meaning if you are working in 3D sculpting for eg, then type a short paragraph over 32 characters - you'll loose all your undo steps.
Proposed solution is for undo systems to support counting their undo steps separately, so text editing operations wouldn't use up undo steps for edits in other modes.
Added subscriber: @ideasman42
Design for undo systems co-existing usefullyto Text editor undo system, undo step limiting behaviorAdded subscriber: @DanielGrauer
Added subscriber: @NoBlahBlah
Somewhat unrelated but if you go ahead with this maybe you could also create a local undo stack for the knife tool as well, that only stays in memory for the duration of the operation.
Added subscriber: @KaiJaegersen
Added subscriber: @rdmo
An Undo modal/dialog could help. Its "Tagged Undo" subsystem/layer/tree/table could use time-stamps and context tags to distinguish undo actions. This way, for example, Text Editor events wouldn't have to be undone just so that 3D-View actions can be undone, even if they took place about the same time. Not all undoable actions show up in the Info area, so for this implementation, 'Alt+z' would display a dialog of user input events, listed by tag (context) columns, with check boxes in each action cell and for each individual context-based event group.
The dialog table header would be something like this: | Context | User | Input Event(s) | Activity |
There would also be a "Recover" button to undo the checked events. The user would be able to set the name of their activity in Blender at a given time, again by toggling the table display via 'Alt+z'. Uses for this would be activity logging for reports, or self-audit. An undo action group, determined by the 'Recover' event in the 'Alt+z' dialog would be logged as a single complete (undoable) reference action, no matter the checked (and unchecked) events rolled back (and not).
Action-tracking like this becomes like recording a Vim or Neovim macro. It might be an easier step toward resolving Undo trees. It is both better and worse than full implementation of an Undo tree. Better, because it can get the user to focus on what they want to repeat, but also worse because unrecorded Undo information may be lost or limited to linear undo.
Beyond this, for the UI, the use of a built-in Mercurial/Git/Subversion/GNU Bazaar in a bpy.context-sensitive processing implementation could help. Using any one of them might even be the least trouble to implement, since they already exist, are stable, and are maintained globally by interested third parties. Depending on the footprint and resource/speed hit the Blender runtime might take, I'd be very much inclined in this case not to reinvent anything, and instead suggest going for a built-in versioning system. To the extent possible, the smaller context and event logs would want to be kept in memory, even with SSD speeds, rather than being repeatedly written to and read from disk like the larger processes and events might.
A versioning system in this situation could take all-blend-data snapshots from time to time and also record only events and user actions, instead of bpy.data snapshots. I have rarely used versioning systems to store binary content, so I don't know how much this affects the ideas mentioned here. To pick one might require comparable, Blender-specific speed tests on each of the revision systems.
For the GUI, an alternative or addition to a dialog launched by Alt+z (configured in User Preferences), the key combination could be used to maximise the space_outliner.py area. This would be useful because the Data API would keep Undo records in a new subtree listing in the Outliner.
Preferences > Keymap > Text > Text (Global) does not seem to have an entry for Ctrl+z/Undo. Nor does Preferences > Keymap > Text > Text Generic.
Do you think that implementing User Preferences-based control of bpy.ops.ed.undo() (differential undo) or a Text Editor-specific Undo action (something using stateful undo bpy.data.text.[...]) could be an incremental improvement?
Added subscriber: @PratikPB2123