Hi all,
I found I problem with the CodeCompletion plugin. It was not finding some symbols in my code. At first, it seemed random, but I could trace down the problem to lines that had a strange combination of spaces and tabs, after doing some debugging.
Here is an example code (. means space and > is the final position of a tab, my settings are tab=4 spaces)
void main(void)
{
>int aabbaa;
>aabbaa
}
(The code above has one tab before each declaration)
If you right click and say go to declaration, it works...
Now, replace the tab before aabbaa (equivalent to 4 spaces) with space+space+tab. The final code is:
void main(void)
{
>int aabbaa;
.. >aabbaa
}
With this code, if you right click on aabbaa and say go to declaration, is says "Not found".
This is because the tab is expanded in the nativeparser.cpp at line 2169
actual_search.Replace(_T("\t"), tabwidth);
actual_search.Remove(col);
, so each tab is replaced with 4 spaces, but the next line truncates the line based on the column position from screen, so 2 characters are left out. The reason is that the tab on editor is equivalent to 2 spaces only, keeping an indentation of 4.
I found a way to solve this by using the GetTextRange() function from wxscintilla...
actual_search = searchData->control->GetTextRange(searchData->control->PositionFromLine(line), pos);
A patch is attached against svn trunk r6857...
I'm using the patch in my systems and it seems to be working fine now.