pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.33k stars 140 forks source link

[find-and-replace] Replace-all error in multiple files with regex #988

Open Tamaranch opened 6 months ago

Tamaranch commented 6 months ago

Thanks in advance for your bug report!

What happened?

When I tried to massively replace #include <header> with #include "header" for local headers, I found that an error had crept into an otherwise correct set of replacements (worrying).

Pulsar version

1.116.0

Which OS does this happen on?

🐧 Arch based (Manjaro, Garuda, etc.)

OS details

Arch Linux

Which CPU architecture are you running this on?

x86_64/AMD64

What steps are needed to reproduce this?

I don't know if it's possible to isolate the problem any further, in any case it's not reproducible without replacing in several files at once.

  1. Clone https://gitlab.xfce.org/apps/mousepad.git and checkout 0f7f29de820066c99ca12ec64c07f2da5cd7769e
  2. Open the project in pulsar
  3. Replace-all in multiple files with regex enabled and: Search-field: #include <(mousepad/.*)> Replace-field: #include "$1" Filter-field: *.c

You end up with

#include <mousepad/mousepad-private.h>
#include <mousepad/mousepad-application.h>

replaced with

#include "mousepad/mousepad-private.h"
#include "mousepad/mousepad-private.h"

in mousepad/main.c, while the other replacements are correct (although I haven't checked them all one by one).

Additional Information:

No response

Tamaranch commented 6 months ago

Hm, could be similar to https://github.com/pulsar-edit/pulsar/issues/942.