From 2b34b1d49f56d2df2eb344af866ffa5ca197fbb2 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 19 Sep 2013 18:34:43 +0000 Subject: [PATCH] ide: Alt+I now jumps to type definition if method is not declared #510 git-svn-id: svn://ultimatepp.org/upp/trunk@6372 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Goto.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uppsrc/ide/Goto.cpp b/uppsrc/ide/Goto.cpp index a3973a752..98631bae9 100644 --- a/uppsrc/ide/Goto.cpp +++ b/uppsrc/ide/Goto.cpp @@ -245,14 +245,17 @@ bool Ide::SwapSIf(const char *cref) q = FindItem(n, qitem); int count = q >= 0 ? GetCount(n, q) : 0; if(!cref && count < 2) { + int typei = -1; for(int i = 0; i < n.GetCount(); i++) { - if(i >= n.GetCount()) - return false; + if(n[i].IsType()) + typei = i; if(i != q && n[i].name == p.current_name) { GotoCpp(n[i]); return true; } } + if(typei >= 0) + GotoCpp(n[typei]); return false; } if(count < 1)