From 653b421e41316e680d1adb3b58f1ea4e5ea02cf6 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 23 Jul 2015 19:14:18 +0000 Subject: [PATCH] ide: ContextGoto fixes #1198 git-svn-id: svn://ultimatepp.org/upp/trunk@8736 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/ContextGoto.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/uppsrc/ide/ContextGoto.cpp b/uppsrc/ide/ContextGoto.cpp index 61789920c..68227abb6 100644 --- a/uppsrc/ide/ContextGoto.cpp +++ b/uppsrc/ide/ContextGoto.cpp @@ -206,6 +206,8 @@ void Ide::ContextGoto0(int pos) else break; } + if(qual.GetCount() == 0) + qual = ":"; } Vector scope; @@ -234,9 +236,12 @@ void Ide::ContextGoto0(int pos) Vector ns = parser.GetNamespaces(); + if(qual.GetCount() > 2 && qual.StartsWith("::")) + qual = qual.Mid(2); if(qual.GetCount()) { // Ctrl::MOUSELEFT, Vector::Iterator Vector todo; - String qa = Qualify(CodeBase(), parser.current_scope, qual + "::" + id, parser.context.namespace_using); + String qa = Qualify(CodeBase(), parser.current_scope, *qual == ':' ? id : qual + "::" + id, + parser.context.namespace_using); qa = RemoveTemplateParams(qa); if(CodeBase().Find(qa) < 0) { // Upp::FileTabs::RenameFile int q = qa.ReverseFind("::"); @@ -247,6 +252,10 @@ void Ide::ContextGoto0(int pos) istype.Add(false); } } + else { + scope.Add(Null); // Add global namespace + istype.Add(false); + } } todo.Add(qa); while(scope.GetCount() < 100 && todo.GetCount()) {