Author Topic: Find Declaration leaves declaration hidden  (Read 6148 times)

Offline k1mgy

  • Multiple posting newcomer
  • *
  • Posts: 64
Find Declaration leaves declaration hidden
« on: November 23, 2005, 03:24:41 am »
Find Declaration is nice.  It finds the declaration, but puts the cursor

void incrementError(char *fmt, ...)
{
<-here

and therefore this text:
  void incrementError(char *fmt, ...)
  {
appears beyond the visible area at the top of the viewport.

Note: my formatting convention is
funcname()
{
not
funcname(){

Is this a bug?
« Last Edit: November 23, 2005, 03:29:14 am by k1mgy »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Find Declaration leaves declaration hidden
« Reply #1 on: November 23, 2005, 07:54:24 am »
Is this a bug?
I would wonder because I for myself like exactly this. I believe in most cases you want to change something inside the funtion if you are searching for the declaration, not the declaration itself. So if you start inside the function you save 2x "cursor down"... :lol: I guess it's a philosophic question...

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline k1mgy

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Find Declaration leaves declaration hidden
« Reply #2 on: November 23, 2005, 10:59:04 am »
For me it's a confidence question.  Each time I ask "is this the function"?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Find Declaration leaves declaration hidden
« Reply #3 on: November 23, 2005, 11:08:48 am »
For me it's a confidence question.  Each time I ask "is this the function"?
I see... but how can you be sure if the cursor is just 1 or 2 lines above? It's the same algorithm that would be used, so you have to trust C::B anyway...?!

Morten.

...dropping out.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline k1mgy

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Find Declaration leaves declaration hidden
« Reply #4 on: November 23, 2005, 11:15:08 am »
It's annoying and yes I can live with it, but am hoping that it can be fixed someday. 

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Find Declaration leaves declaration hidden
« Reply #5 on: November 23, 2005, 11:23:23 am »
but am hoping that it can be fixed someday. 
Uuuh, uuuh! *snap*, *snap* While discussion around: Did you try the current CVS version? It seems there it's operating the way you want it to operate... at least on my sources... :)

Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: Find Declaration leaves declaration hidden
« Reply #6 on: November 23, 2005, 12:21:35 pm »
Hey folks,

just being a purist :

void f(int arg1, , int arg2);

This is the declaration of a function !!!

void f(int arg1, int arg2)
{
  // my superior implementation  ;-)     (ever seen code with a smile displayed in it)
}

This is the definition, so when asking to see the declaration you should see the first flavour.


Anyone tested where the cursor ends up for a declaration like :

void function(
   int arg1,
  int arg2);


Cheers,
Lieven

Offline k1mgy

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Find Declaration leaves declaration hidden
« Reply #7 on: November 24, 2005, 08:19:52 pm »
I installed binaries prepared by Ceniza http://gda.utp.edu.co/~ceniza/CodeBlocks/ and now "find declaration" brings it into focus smack dab in the middle of the viewport, which is just fine.

Killerbot is right (and this nuance slipped by me) the menu is labled "Find Declaration" where it ought to be labeled "Find Definition".  I suppose both might be nice, actually.

Now hoping for that "Return to Origin".

/m

takeshimiya

  • Guest
Re: Find Declaration leaves declaration hidden
« Reply #8 on: November 24, 2005, 08:52:44 pm »
k1mgy, what you're suggesting, generally speaking is a navigation system with back and forward, just like any internet browser.

Just submit a feature request to the SF tracker.