pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

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

Open Tamaranch opened this issue 1 year ago • 1 comments

Thanks in advance for your bug report!

  • [X] Have you reproduced issue in safe mode?
  • [X] Have you used the debugging guide to try to resolve the issue?
  • [X] Have you checked our FAQs to make sure your question isn't answered there?
  • [X] Have you checked to make sure your issue does not already exist?
  • [X] Have you checked you are on the latest release of Pulsar?

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 avatar Apr 24 '24 14:04 Tamaranch

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

Tamaranch avatar Apr 24 '24 15:04 Tamaranch