\n

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
AlanStewart
Posts: 83
Joined: Fri Jun 02, 2006 6:52 pm

\n

Post by AlanStewart »

I have a registered version of 3.96o, which I just recently upgraded to via the usual way of overwriting over my 3.96n version of Zeus. I finally got around to trying out the new and improved \n support and noticed something a little odd, for me at least.

I was searching for instances of "<br>\n" and replacing them with "" (ie, getting rid of the lines I no longer wanted). Normally I would've expected that the lines would just disappear (what I wanted) but , because the line above the <br> is indented, I noticed that the line *below* the <br> ends up indented as well, after the replacement. I strongly suspect that this has to do with the smart indenting being a little too over-zealous in doing its job.

Let's see if I can do an example:

Code: Select all

   xhtml_code
      text
   <br>
   more_code
What I want to see is:

Code: Select all

   xhtml_code
      text
   more_code
What I'm seeing is:

Code: Select all

   xhtml_code
      text
      more_code
Hope that helps?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Alan,
I strongly suspect that this has to do with the smart indenting being a little too over-zealous in doing its job.
The search and replace has in fact work correctly, since you did not include the leading white space in the search.

The correct search string should have been: <br>\n[ ]+ ;)

But you have indirectly found a bug in the Zeus 3.96o beta, since the <br>\n[ ]+ search string was not being handled correctly by the beta version :(

This bug will be fixed in the official Zeus 3.96o release, due shortly ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The latest Zeus patch fixes this bug and it can be found here: http://www.zeusedit.com/forum/viewtopic.php?t=1790

Cheers Jussi
AlanStewart
Posts: 83
Joined: Fri Jun 02, 2006 6:52 pm

Post by AlanStewart »

I *think* it's working now. Hard to say since my original request was buggy to begin with.

What I was searching for and replacing was actually working. The indenting I thought I was seeing was from the leading spaces no being removed. So that's all cool.

I did try searching for " +<br>\n" and replacing with "" and that gave me the results that I was expecting. However, this worked even *without* turning on the "Use Regular Expression" checkbox.

Also, because I left the "Replace with" box "empty" (ie. nothing in there), whenever I *next* open up the dialong box, the "Replace with" value is set to something that *isn't* "" and so I have to be extra vigilant that I don't do a global search'n'replace for "<br>" with "img".
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

so I have to be extra vigilant that I don't do a global search'n'replace for "<br>" with "img".
If you did manage to run an incorrect replace all you can always just undo the last change made. No matter how many changes get made by the replace all, they will all be grouped, so they can all be undone by the single undo command ;)

FWIW one of the habits I uses is to tick the repeat find on replace option and when I need to do a replace all I usually run a find, followed by a replace, followed by a replace all. I find this an easy way to check that the search and replace details have been defined correctly ;)

Cheers Jussi
Post Reply