evil icon indicating copy to clipboard operation
evil copied to clipboard

Substitution preview for "\#" is incorrect

Open blahgeek opened this issue 2 years ago • 1 comments
trafficstars

Issue type

  • Bug report

Environment

Emacs version: 29.1 Operating System: linux Evil version: 1.15.0 Evil installation type: borg (git clone) Graphical/Terminal: graphical Tested in a make emacs session (see CONTRIBUTING.md): yes

Reproduction steps

  • :%s/^/\#/g, do NOT press enter, see the preview result

Expected behavior

Shows substitution preview 0,1,2,3,... in each line

Actual behavior

Shows substitution preview 0,0,0,0,... in each line

Further notes

The final result (after pressing enter) is correct though.

blahgeek avatar Aug 25 '23 13:08 blahgeek

This is a (semi-)intentional limitation: Currently the substitution preview only processes the part of the buffer that is visible. Showing an accurate counter would require processing the entire range, which could be bad for large buffers. I am not sure whether this should be changed.

axelf4 avatar Aug 25 '23 16:08 axelf4