On Sep 25, 2006, at 7:55, Bryan Harris wrote:
I've requested several times that they add a "balance count" to one of the
tool bars, so if I type:

   while (@data) {  if ($x) { if ($y

... the balance count shows:

  +2 {, +1 (

I agree that would be useful in certain situations. Making it even more useful would be if it could show you the upward tree of any language structure, not just brackets. So for instance, if I have this HTML in my window:

  ...
  <table>
    <thead>
      <tr>
        <insertion point>
      </tr>
  </table>
  ...

the status display would show something like:

  html > body > table > /thead/ > tr

to show me both what the structure is at the current point in the document, and whether that structure is properly balanced (in this case, the thead isn't balanced, so it's marked). Language-specific settings could be used to, for example, hide the html and body contexts.

This would be especially useful when I have to work on HTML documents that someone else generated with GoLive or something.

Implementing this would require adding some basic (as in low-level, not easy!) intelligence to the parser that it doesn't already have. For example, the Balance command will balance the bracket pairs in this PHP code:

  if ($foo) {
    $bar();
  } else {
    baz();
  }

but it doesn't understand the non-brackets-based if structure in this equivalent:

  if ($foo):
    bar();
  else:
    baz();
  endif;

which I prefer because of its increased readability. I've also noticed that the Close Current Tag command for HTML is almost always broken once a page starts incorporating some PHP; I'm not sure how or if that relates to the Balance command internally, but it could be indicative of yet more work needing to be done under the hood to bring this suggestion to life. (Of course, I wouldn't mind these shortcomings getting addressed in any case....)

Any thoughts on my revised version?


Regards,
Bob

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to