mhayashi1120 / Emacs-wgrep

Writable grep buffer and apply the changes to files
GNU General Public License v3.0
661 stars 43 forks source link

wgrep marks top 2 lines as read-only by mistake #92

Closed jasonjckn closed 1 year ago

jasonjckn commented 1 year ago
image

The screenshot shows me trying to do :%s/router/router2/g on wgrep buffer, this bug reproduces deterministically , and it's typically the top 2 lines that are marked read-only.

To reproduce, get vanilla doom, and add this LOC to your config

(add-hook! 'grep-mode-hook #'wgrep-change-to-wgrep-mode)

Then follow, I followed project-wide search & replace at https://hungyi.net/posts/doom-emacs-search-replace-project/ SPC s p foo C-; E C-c C-p :%s/foo/bar/g RET Z Z

I don't think this a doom bug by any means, but it's just how I tested reproduction of it.

There's probably some kind of concurrency issue (?) when switching to wgrep too quickly.

thierryvolpiatto commented 1 year ago

Jason Jackson @.***> writes:

  1. ( ) text/plain (*) text/html

image

The screenshot shows me trying to do :%s/router/router2/g on wgrep buffer, this bug reproduces deterministically , and it's typically the top 2 lines that are marked read-only.

To reproduce, get vanilla doom, and add this LOC to your config

(add-hook! 'grep-mode-hook #'wgrep-change-to-wgrep-mode)

Don't do that, when grep-mode-hook runs grep is not already done, hence your bug. Run manually wgrep-change-to-wgrep-mode once your grep is done.

-- Thierry