Author Topic: About "Swap header/source"  (Read 9081 times)

Offline zhanglyl

  • Single posting newcomer
  • *
  • Posts: 4
About "Swap header/source"
« on: April 10, 2013, 04:51:07 am »
I'm using Code::Blocks 12.11 downloaded from sourceforge.net, not nightly build version.

When coding, I often swithed my codes between the .cpp and .h file by shortcut key. Before Code::Blocks, I was a coder of Borland C++ Builder.

"Swap header/source" in Code::Blocks, the function is different by "menu click" and by "shortcut key".

In IDE for example, there are 4 files opened orderly on tabs like this: a.cpp, b.cpp, a.h, b.h.

"a.cpp" is the current edited file.
1, When clicked "Swap header/source" from Edit menu, the current file jumped "a.h". Clicked the menu again, it returned to "a.cpp" normally. This is OK!

2, When from shortcut key "Ctrl+F6" I used, the current file jumped from "a.cpp" to "b.cpp". Pressing shortcut keys again, it jumped next to "a.h".  For the definition of "Swap header/source", this is a bug.

Please check it. Thank you very much.

stefanos_

  • Guest
Re: About "Swap header/source"
« Reply #1 on: April 10, 2013, 08:48:09 am »
zhanglyl, I don't know where you have found such key combination, but from Editor's hotkey shortcuts i have found "F11" be the one which works. True though, by pressing Ctrl+F6 and Ctrl+Shift+F6 makes navigation much pleasant than we can imagine.

Did you know you can use Ctrl+F6....

Offline zhanglyl

  • Single posting newcomer
  • *
  • Posts: 4
Re: About "Swap header/source"
« Reply #2 on: April 10, 2013, 10:31:53 am »
stefanos_, Thank you very much. In the configuration of "Keyboard shortcuts", I changed "Ctrl+F6" to "F11" for "Swap header/source". It works well.

This is NOT a bug. Maybe the combination key of Ctrl+F6 is preset in somewhere. But I couldn't find it.

stefanos_

  • Guest
Re: About "Swap header/source"
« Reply #3 on: April 10, 2013, 10:48:00 am »
You said you have changed from Ctrl+F6 to F11...why did you choose Ctrl+F6 is beyond my understanding; maybe you feel comfortable with it, I don't know.

Anyway, what comes in mind even if you have assigned your own hot keys, is that Windows itself sets higher precedence to Operating System's hot keys than to user-defined.

I went to "Settings > Editor > General settings > Other settings > Other options > Open containing folder" and saw there the "explorer.exe /select," option which makes me think that this setting COULD set the priority higher than user's settings. By the way, do not edit this setting!

That's my speculation though, you should not take it for granted.