GNOME Bugzilla – Bug 346538
gedit search and replace double backslash leaves trailing backslash
Last modified: 2006-07-04 20:15:25 UTC
Please describe the problem: When you want to replace all of the // (slash pairs) by nothing you still get a trailing /. Could be a consequence of fixing Debian Bug #361399 in a wrong way. Steps to reproduce: 1. Open a document 2. Write some text having // and some other characters (it's _mandatory_ to have some other characters on the line, apart from the doublets of backslashes!) 3. Click on Search & Replace 4. Search // and replace by nothing 5. Click on "All" Actual results: Instead of nothing, you still get a single slash Expected results: All of the matched strings "//" should be took away Does this happen every time? Everytime Other information: It's _mandatory_ to have some other characters on the line, apart from the doublets of backslashes!
I'm stupid. Please read BACKSLASHES pairs: "\\" !!!
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. This is not a real bug, it's a design decision: '\' needs to be escaped as '\\' so that we can use \n and \t to search and replace multiline strings. *** This bug has been marked as a duplicate of 332549 ***
Steve, may I have the opinion that this is _not_ a correct design decision? It would be so if the it were about this scenario: "if you want to and replace \t, write them in the dialog box as \\t, for not taking the for tabs". But the scenario is this: "if you select a text containing \t, the search and replace dialog box shows automatically the selected text with \t instead of \\t". This is a behavioral bug. The select and replace dialog should replace in the selected text \ with \\ before displaying!
May I suggest you that's exactly what Paolo Borelli said in bug #332549 comment #1 ? Paolo Borelli said: “The bug is that when selcting text and pressing ctrl+F the text should be escaped automatically.” There was no need to cut-and-paste your reply three times, we gedit team get a mail notification for each comment people put on any gedit-related bug.
Yes, Steve, thank you very much. Paolo got it right, it should be escaped automatically. However you said it's a design decision, which was a different point of view.