NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
jump out to select/match braces from anywhere between braces


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Matching braces is good, and selecting matching braces content is good, too. However, for it to work, you currently have to sit atop one of the terminal braces you wish to match. I would like to see a "Select out:"
Code:
function fun() {
// some code
// some code and my cursor
// some code
}

In the code above, I should be able to match braces from anywhere within the function "fun()". In fact, it might be nice to select-out-until-top-level when exercising this new feature from within nested code blocks.
View user's profileFind all posts by bcswebstudioSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
BBEdit does this for its balance function, and it's indeed quite useful.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
when selection is not persistent (it's not by default), cursor may be either at the beginning or at the end of selection, nowhere else. How to make whole the function body selected while cursor is somewhere in between?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
I'm not quite sure what you mean, but the way it behaves in BBEdit is that the cursor *becomes* the selection. That is, whenever there's a selection, you don't also see a cursor blinking. Once the selection is made, you can press left-arrow to clear the selection and place the cursor where the selection started, or press right-arrow to clear the selection and leave the cursor where the selection ended.

Thus, wherever you happen to be, you can pound command-B, and BBEdit will create and grow a selection in both directions until it hits the first set of matching braces. Hit command-B again, and the selection grows to the second set, and so on. Makes it easy to not only check that braces are properly balanced, but also grab bits of code (e.g., function arguments) to copy-and-paste elsewhere. You can also double-click on any brace to select its entire contents (and optionally, the braces themselves).
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
jump out to select/match braces from anywhere between braces
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic