User forums > Using Code::Blocks
Bug in 'swap header / source'
CuteAlien:
Testing this with latest nightly build (svn 5911) it seems that currently c::b always prefers switching to a header/source which is already opened. If several files with a fitting name are open then it switches to the one which was opened first. Regardless if those files are in the same project or folder. It only works correct (for my case) when no file with a fitting name is already opened.
ironhead:
The behaviour on the trunk is still unchanged. I unfortunately have not had time to work on a new version of the patch. If someone else has time and is willing to take a stab at it, I'd be happy to help out.
MortenMacFly:
Please have a look at Patch #2803 at BerliOS patch tracker. From my point of view this has most chances to implement a "correct" behaviour. I am testing this for a while now. Most likely it solves your problems.
oBFusCATed:
Sorry for resurrecting this topic, but I wanted to make this feature work for file where the case doesn't match.
The code seems pretty complex and I don't won't to change it, is anyone willing to implement such feature?
My current problem is that these to files: myfile.h and MyFile.cpp are not swapped correctly.
The example project is also missing.
Alpha:
Maybe something like this? (Warning, not yet heavily tested.)
--- Code: ---Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp (revision 8646)
+++ src/sdk/editormanager.cpp (working copy)
@@ -1014,8 +1014,8 @@
bool EditorManager::IsHeaderSource(const wxFileName& candidateFile, const wxFileName& activeFile, FileType ftActive)
{
- // Verify the base name mathes
- if (candidateFile.GetName() == activeFile.GetName())
+ // Verify the base name matches
+ if (candidateFile.GetName().CmpNoCase(activeFile.GetName()) == 0)
{
// Verify:
// If looking for a header we have a source OR
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version