mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: Improved Alt+J on layout item
git-svn-id: svn://ultimatepp.org/upp/trunk@5941 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
bcf180b527
commit
17b8d78fd1
4 changed files with 15 additions and 11 deletions
|
|
@ -1148,7 +1148,7 @@ void Ide::ContextGoto0(int pos)
|
|||
const Array<CppItem>& n = CodeBase()[q];
|
||||
for(int i = 0; i < n.GetCount(); i++) {
|
||||
if(n[i].IsType() == istype && n[i].name == id) {
|
||||
JumpToDefinition(n, i);
|
||||
JumpToDefinition(n, i, scope[j]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1166,7 +1166,7 @@ void Ide::CtrlClick(int pos)
|
|||
ContextGoto0(pos);
|
||||
}
|
||||
|
||||
void Ide::JumpToDefinition(const Array<CppItem>& n, int q)
|
||||
void Ide::JumpToDefinition(const Array<CppItem>& n, int q, const String& scope)
|
||||
{
|
||||
String qitem = n[q].qitem;
|
||||
int i = q;
|
||||
|
|
@ -1200,8 +1200,8 @@ void Ide::JumpToDefinition(const Array<CppItem>& n, int q)
|
|||
EditFile(path);
|
||||
LayDesigner *l = dynamic_cast<LayDesigner *>(~designer);
|
||||
if(l) {
|
||||
if(pos.name.StartsWith("With"))
|
||||
l->FindLayout(pos.name.Mid(4));
|
||||
if(scope.StartsWith("With"))
|
||||
l->FindLayout(scope.Mid(4), pos.name);
|
||||
}
|
||||
else {
|
||||
editor.SetCursor(editor.GetPos(pos.line - 1));
|
||||
|
|
@ -1226,7 +1226,7 @@ void Ide::IdeGotoCodeRef(String coderef)
|
|||
const Array<CppItem>& n = CodeBase()[q];
|
||||
q = FindItem(n, item);
|
||||
if(q >= 0)
|
||||
JumpToDefinition(n, q);
|
||||
JumpToDefinition(n, q, scope);
|
||||
}
|
||||
|
||||
bool AssistEditor::Esc()
|
||||
|
|
|
|||
|
|
@ -436,8 +436,7 @@ private:
|
|||
void SaveEditPos();
|
||||
void RestoreEditPos();
|
||||
|
||||
void FindLayout(const String& name);
|
||||
|
||||
void FindLayout(const String& name, const String& item_name);
|
||||
|
||||
bool Load(const char *filename, byte charset);
|
||||
|
||||
|
|
@ -465,7 +464,8 @@ public:
|
|||
|
||||
void Serialize(Stream& s) { designer.Serialize(s); }
|
||||
bool Load(const char *filename, byte cs) { return designer.Load(filename, cs); }
|
||||
void FindLayout(const String& name) { designer.FindLayout(name); }
|
||||
|
||||
void FindLayout(const String& name, const String& item) { designer.FindLayout(name, item); }
|
||||
|
||||
LayDesigner() { parent.Add(designer.DesignerCtrl().SizePos()); }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -81,9 +81,13 @@ void LayDes::RestoreEditPos()
|
|||
SyncItems();
|
||||
}
|
||||
|
||||
void LayDes::FindLayout(const String& name)
|
||||
void LayDes::FindLayout(const String& name, const String& item_name)
|
||||
{
|
||||
layoutlist.FindSetCursor(name);
|
||||
if(layoutlist.FindSetCursor(name) && !IsNull(item_name)) {
|
||||
int q = item.Find(item_name, 1);
|
||||
if(q >= 0)
|
||||
SelectOne(q, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool LayDes::Load(const char *file, byte _charset)
|
||||
|
|
|
|||
|
|
@ -1057,7 +1057,7 @@ public:
|
|||
bool OpenMainPackage();
|
||||
void NewMainPackage();
|
||||
|
||||
void JumpToDefinition(const Array<CppItem>& scope, int q);
|
||||
void JumpToDefinition(const Array<CppItem>& n, int q, const String& scope);
|
||||
void SearchTopics();
|
||||
void ShowTopics();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue