Skip to content

undo region, multibuffer/nrrwrgn (many buffers stitched together as one virtual buffer) #30463

Description

@orenbenkiki

Problem

The ability to select a region of the file (probably via visual selection would be most popular), and then undo only operations that affected that region.

That is, make it possible to do some changes in some file region, move to another part of the file, make other changes, and then undo just the changes in the first part.

A classical use case is adding debug. prints in different areas of a file. Currently, one has to manually revert any debugging changes made in each region once the problem is determined to be somewhere else.

I realize this is "out there" but I find myself missing this feature frequently enough to at least ask.

Expected behavior

Having some variant of u and/or U which would apply only to the currently selected region. The key binding is the least of the problem here. Undo would be linear (reverse order of changes) for all operations that affected the region. For operations that also had impact outside the region, it is a question whether to include them or not; I tend towards "yes" but that might need to be configured or controlled somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity:highHigh-risk, potential for delicate/cascading effectseditoreditor features, user workflows, bufferzzzzeditor-statesave/restore editor state: shada, context, ctx, sessions, mksession, undo, swapgsoccommunity: Google Summer of Code project

    Fields

    Effort

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions