Author Topic: take me to the opening brace '{' that encloses this line of code.  (Read 1551 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
When the cursor is on a specific line of C code, I'd like to be able to press a button to take me to the opening brace '{' that encloses this line of code.

For example:

Code: [Select]
for ()
{
  line 1;
  line 2;
  line 3;
}

If my cursor was somewhere on "line 2", I'd like to be able to hit a button and end up at the opening brace of the "for" loop.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: take me to the opening brace '{' that encloses this line of code.
« Reply #1 on: July 28, 2015, 06:50:37 AM »
@rowbearto: Try the 'goto-parent' command. You might wrap into a user macro to goto the opening brace if existing.
HS2

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: take me to the opening brace '{' that encloses this line of code.
« Reply #2 on: July 28, 2015, 01:07:08 PM »
Thanks hs2! goto-parent does exactly what I want!