News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Irregular comportement for the F11 shortcut

Started by Loumnam, March 26, 2010, 12:54:34 PM

Previous topic - Next topic

Loumnam

Hi,

The F11 shortcut let you switch from a *.c/*.cpp to a *.h.
But if the corresponding *.c/*.cpp/*.h doesn't exists, it proposes to create it.

The problem is:

I am in a C project.
I create a *.h file, e.g. array.h.
I then press F11.
array.c/cpp doesn't exists, so it propose me to create it.
But it creates array.CPP, while I am in a C project!
And it is not just the extension: the file is considered in all aspects as a c++ file (in the *.cbp, CompilerVar= CPP and not CC, etc..)

Thanks for correcting this bug!

P.S: In case this is the desired comportement, a toolbox with the option to choose between C/C++ would be appreciated.

Thanks!

oBFusCATed

And another one... please follow the forum rules and state a version of CB, OS, compiler  :? :lol:

BTW, If you're using 8.02 you can try a nigthly.... there were some problems in C handling in the past
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Loumnam

Oops, sorry!

Codeblocks SVN 6181
OS: Kubuntu 9.10 32bits
Compiler: gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1


oBFusCATed

I suppose this is just a bug, c::b is used mostly as c++ ide...

You can submit a bug report at the berlios.de page and wait to be fixed...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: Loumnam on March 26, 2010, 12:54:34 PM
But it creates array.CPP, while I am in a C project!
There is no such thing like a C project. All projects are C/C++. However, to create the right file for you (with an extension .c) why don't you simply name the full file name, including the extension as you need, like "blah.c"?!

*.h files are also valid for C++, so the IDE cannot know what exactly you want to do (unless you tell by the file extension yourself).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: MortenMacFly on April 11, 2010, 08:07:50 PM
There is no such thing like a C project. All projects are C/C++. However, to create the right file for you (with an extension .c) why don't you simply name the full file name, including the extension as you need, like "blah.c"?!

*.h files are also valid for C++, so the IDE cannot know what exactly you want to do (unless you tell by the file extension yourself).
Yes but hitting f11 in a header (blah.h) doesn't ask you if you want to create .cpp or .c, it always creates blah.cpp file.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: oBFusCATed on April 11, 2010, 08:11:28 PM
Yes but hitting f11 in a header (blah.h) doesn't ask you if you want to create .cpp or .c, it always creates blah.cpp file.
Not for me :-)

But I recall that I did some modifications in that part of C::B literally ages ago... probably I did that already and forgot to submit... I need to check...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]