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

rowbearto

  • Senior Community Member
  • Posts: 1386
  • Hero Points: 105
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: 2737
  • Hero Points: 288
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: 1386
  • Hero Points: 105
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!