Author Topic: typedef problem in c language  (Read 2158 times)

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
typedef problem in c language
« on: October 30, 2013, 07:45:12 AM »
Hi Expert,

   there are codes like below, when I type CTRL+.  , slickedit will jump to the typedef place (line 2318) instead of original structure definition (line 1516)

1516    : structure my_data {
...........: .........
1548    : };

..........

2318     : typedef struct my_data my_data;


Is there any option setting to jump to 1516?

Thanks,
Lu Su

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: typedef problem in c language
« Reply #1 on: October 30, 2013, 09:21:43 PM »
Hi Lu Su

There's no option that I know of but you can try this.  Ctrl dot should get you to the actual struct, skipping the typedef.  Ctrl+, will stop at the typedef on the way back.  You could bind Ctrl+. to preview_push_tag.  You can change the function name if you want, and take out the call to show_preview() if you don't want the preview window activated.

Code: [Select]
_command void preview_push_tag() name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
   int x;
   show_preview();
   push_tag();
   if (cur_word(x) == 'typedef')
   {
      next_word();
      if (cur_word(x) == 'struct')
         next_word();

      push_tag();
   }
}