Author Topic: v21 feature preview: edit-associated-symbol (jump between func and prototype)  (Read 1663 times)

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2542
  • Hero Points: 373
The attached macro provides a convenient way to jump from the current function you are working on to it's prototype (and back).  This is similar to the idea behind edit-associated-file (to jump between .cpp and .h) files, except it would operate on the symbol level, hence the appropriate name would be edit-associated-symbol, and Alt+` would be an easy to remember binding since edit-associated-file is Ctrl+`.

Example:

// test.cpp
int foobar(int x, int y<cursor here>) {  // hit Alt+', switches to test.h
   x += 32;
   y =- 32;
   if (x==y) return 0;
   return x+y;
}

// test.h
extern int<cursor here> foobar(int x, int y);  // hit Alt+`, switches back to test.cpp
« Last Edit: May 16, 2016, 09:22:26 pm by Dennis »

Phil Barila

  • Senior Community Member
  • Posts: 742
  • Hero Points: 61
SE *used to* jump between declaration and definition on Ctrl+Dot.  Does it not anymore?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2542
  • Hero Points: 373
This is different.  You don't have to have your cursor on the function name to use this, just within the body of the function or prototype.  Saves you the time of moving to the cursor to the current function name and then hitting Ctrl+Dot.

Phil Barila

  • Senior Community Member
  • Posts: 742
  • Hero Points: 61
Ah, got it.

hs2

  • Senior Community Member
  • Posts: 2735
  • Hero Points: 287
Cool feature ++Dennis 8)
HS2