Text editor undo system, undo step grouping behavior #71735

Open
opened 2019-11-21 17:33:41 +01:00 by Campbell Barton · 5 comments

This design task is to resolve how to handle undo steps in the text editor (and possible text fields in the future).

Possible options:

  • Keep current behavior - each key is a single unto step.
  • Group by character type / action.
  • Group using a timer, so characters typed in quick succession are put into a single undo step.
The timer can be a preference, so users who type slowly or prefer to have the current behavior can either increase the timer or set it to zero.

Note:

  • Using a timer may be unpredictable especially when the users typing speed hovers around the limit - undo groupings may seem unpredictable.
  • Using whole words may have the disadvantage that large blocks get undone (not fine grained enough).
  • Having grouped undo makes it difficult to test undo/redo (developer detail, even so - noting it here).

Proposal

  • Undo grouping will only be done for single character insertion/removal.
  • Undo wont group edits separated by cursor motion.
  • Word level grouping has the same delimiters as pressing Ctrl-Left/Right,
this means whitespace/punctuation & alpha-numeric characters will be undone/redone in blocks.
  • Have a preference for the text editor to group undo by words or characters.
    (this allows undo testing code to behave predictably).

Maybe there are other options, @WilliamReynish we discussed this a while ago.

Creating because D6283: Add undo grouped to Insert and Delete text operator was submitted which.

This design task is to resolve how to handle undo steps in the text editor (and possible text fields in the future). Possible options: - Keep current behavior - each key is a single unto step. - Group by character type / action. - Group using a timer, so characters typed in quick succession are put into a single undo step. ``` The timer can be a preference, so users who type slowly or prefer to have the current behavior can either increase the timer or set it to zero. ``` Note: - Using a timer may be unpredictable especially when the users typing speed hovers around the limit - undo groupings may seem unpredictable. - Using whole words may have the disadvantage that large blocks get undone (not fine grained enough). - Having grouped undo makes it difficult to test undo/redo *(developer detail, even so - noting it here).* ---- **Proposal** - Undo grouping will only be done for single character insertion/removal. - Undo wont group edits separated by cursor motion. - Word level grouping has the same delimiters as pressing Ctrl-Left/Right, ``` this means whitespace/punctuation & alpha-numeric characters will be undone/redone in blocks. ``` - Have a preference for the text editor to group undo by words or characters. *(this allows undo testing code to behave predictably).* ---- Maybe there are other options, @WilliamReynish we discussed this a while ago. Creating because [D6283: Add undo grouped to Insert and Delete text operator](https://archive.blender.org/developer/D6283) was submitted which.
Campbell Barton self-assigned this 2019-11-21 17:33:41 +01:00
Author
Owner

Added subscribers: @WilliamReynish, @ideasman42

Added subscribers: @WilliamReynish, @ideasman42
Member

Added subscriber: @Poulpator

Added subscriber: @Poulpator

Added subscriber: @KaiJaegersen

Added subscriber: @KaiJaegersen
Contributor

Added subscriber: @Matheus-Santos

Added subscriber: @Matheus-Santos
Contributor

I would propose a two level undo for the text editor. While typing a word, all characters are temporarily stacked as undo steps, as soon as an special character is added, this temporary undo stack is flattened into a single undo and added to the main undo stack, also, it would initialize the new stack for the new word.

I would propose a two level undo for the text editor. While typing a word, all characters are temporarily stacked as undo steps, as soon as an special character is added, this temporary undo stack is flattened into a single undo and added to the main undo stack, also, it would initialize the new stack for the new word.
Sign in to join this conversation.
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
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71735
No description provided.