Bug 393444

Summary: "Find-Replace in files" puts "nullptr" string in current file instead of proper value
Product: [Applications] kdevelop Reporter: Piotr Mierzwinski <piotr.mierzwinski>
Component: All editorsAssignee: kdevelop-bugs-null
Status: RESOLVED WORKSFORME    
Severity: normal CC: mail, piotr.mierzwinski
Priority: NOR Keywords: triaged
Version First Reported In: 5.2.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Piotr Mierzwinski 2018-04-23 21:57:14 UTC
Usage option "Find-Replace in files" breaks current file, because put "nullptr" string instead of target string.

Step to reproduce:
1. Open any file from project
2. Double click on string to highlight it (string must be present in more than current file)
3. Invoke Ctrl+Alt+F ("Find-Replace in files")
4. Put some target string
5. Click "Replace"

Current result:
String has been correctly changed in all affected files skipping current one (opened) where has been put string "nullptr"

Expected result
String should be replaced in all affected files including current one (opened)

Note.
Because of this bug user can easy break his project.
I'm not sure if this is related to KTextEditor component or only KDevelop built option.

My platform uses:
  Qt-5.10.1   KF-5.45  Plasma 5.12.4
  KDevelop comes from distribution packages
Comment 1 Sven Brauch 2018-04-23 22:23:36 UTC
Huh. I can't reproduce this issue here. Works fine ...
Comment 2 Piotr Mierzwinski 2018-04-23 23:04:27 UTC
I restarted KDevelop and reproduced this bug - twice. With the same result.

In previous message I was a bit wrong. I mean string "nullptr" is put in all files where searching string matches. In my case all are opened.

To be more clear I need to update my steps:

3. Invoke Ctrl+Alt+F ("Find-Replace in files")
4. Put searched string in dialog - pattern field, press "Search"
5. In result view put new string in "Replacement text" field
6. Click "Replace"

I result:
In all files where string matched I have "nullptr"
Comment 3 Piotr Mierzwinski 2018-04-23 23:14:12 UTC
I made one more test. 
I restarted my PC. And before I cleaned kdevelop cache, I mean: "kdevduchain" folder.
I followed steps placed below and I got the same annoying result.

One more detail.
In "Replacement text" I paste original (searched) string, a bit modifying it and pressed "Replace".
Comment 4 Sven Brauch 2018-04-24 07:05:05 UTC
Very strange. I think I did exactly as you described, with one of the files opened and another not, and all is fine. I have also never seen / heard this before ...
Comment 5 Andrew Crouthamel 2018-09-28 03:30:06 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Piotr Mierzwinski 2018-09-28 21:35:44 UTC
I close this ticket, because I can't reproduce the issue.