benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
392 stars 28 forks source link

Long multiline substitution #50

Open ramblehead opened 7 years ago

ramblehead commented 7 years ago

When (ab)using visual-regexp for refactoring tasks, multiline replacement text might exceed the window height, making it impossible to preview full replacement before running the actual substitution. The problem is that the point does not move through the preview overlay - it jumps from the overlay beginning to its end (line 1143 to 1144 on the screenshot below).

Would it be possible to allow the point to move inside the preview overlay?

screenshot from 2017-04-13 10-45-36

benma commented 5 years ago

Kudos, this is some next level regexp replacing :rocket: :smile: 34 matches too!

The replacement is shown as an after-string of an overlay and is not part of the actual buffer, so it is not navigable/editable/etc:

This property’s value is a string to add to the display at the end of the overlay. The string does not appear in the buffer in any sense—only on the screen.

I've been looking at the docs to find if the behavior can be changed, but with no luck.