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.
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
uand/orUwhich 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.