emacs-evil / evil

The extensible vi layer for Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Substitution preview for "\#" is incorrect

blahgeek opened this issue · comments

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.

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.