I can confirm this bug, I did a git blame, and found this bug was introduced in svn rev
Well but you also see why: Because otherwise global scope will not work. So be careful and do not just revert this change.
This is the change of that commit:
0da216bc5e6471b760be10b3e47b9445a981d37d
src/plugins/codecompletion/codecompletion.cpp | 9 +++++++--
src/plugins/codecompletion/nativeparser.cpp | 4 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/plugins/codecompletion/codecompletion.cpp b/src/plugins/codecompletion/codecompletion.cpp
index 2f41040..9709d6e 100644
--- a/src/plugins/codecompletion/codecompletion.cpp
+++ b/src/plugins/codecompletion/codecompletion.cpp
@@ -1397,7 +1397,10 @@ void CodeCompletion::DoCodeComplete()
const int style = control->GetStyleAt(pos);
const int lineIndentPos = control->GetLineIndentPosition(control->GetCurrentLine());
- if (ed->GetControl()->GetCharAt(lineIndentPos) == _T('#'))
+ const wxChar lineFirstChar = ed->GetControl()->GetCharAt(lineIndentPos);
+ const wxChar curChar = ed->GetControl()->GetCharAt(pos - 1);
+
+ if (lineFirstChar == _T('#'))
{
const int start = control->WordStartPosition(lineIndentPos + 1, true);
const int end = control->WordEndPosition(lineIndentPos + 1, true);
@@ -1409,7 +1412,9 @@ void CodeCompletion::DoCodeComplete()
CodeCompletePreprocessor();
return;
}
- else if (ed->GetControl()->GetCharAt(pos - 1) == _T('#'))
+ else if (curChar == _T('#'))
+ return;
+ else if (lineFirstChar == _T(':') && curChar == _T(':'))
return;
if (style != wxSCI_C_DEFAULT && style != wxSCI_C_OPERATOR && style != wxSCI_C_IDENTIFIER)
diff --git a/src/plugins/codecompletion/nativeparser.cpp b/src/plugins/codecompletion/nativeparser.cpp
index cc865b7..3a4c8b7 100644
--- a/src/plugins/codecompletion/nativeparser.cpp
+++ b/src/plugins/codecompletion/nativeparser.cpp
@@ -1917,8 +1917,8 @@ static bool IsOperatorEnd(int startAt, const wxString& line)
}
static bool IsOperatorBegin(int startAt, const wxString& line)
{
- return ( (startAt > 0)
- && ((size_t)startAt + 1< line.Len())
+ return ( (startAt >= 0)
+ && ((size_t)startAt < line.Len())
&& ( ( (line.GetChar(startAt ) == '-')
&& (line.GetChar(startAt + 1) == '>') )
|| ( (line.GetChar(startAt) == ':')
I take some time to read the code and debug some examples, I don't see what exact bug this commit going to fix.
Here is the code I use:
void f1();
void f2();
namespace nBase {
class A
{
public:
int ObjectA() const { return mObjectA; }
public:
int mObjectA;
};
class B : public A
{
public:
int mObjectB;
};
}
int main()
{
::f // works fine here
return 0;
}
I don't even understand what does "applied patch to fix global scope search failed" means.
What is the relation ship between the first char and the current char?
+ else if (lineFirstChar == _T(':') && curChar == _T(':'))
return;

Maybe, that patch was created by Loaden? but I think Loaden is not active for a very long time.