diff --git a/uppsrc/ide/ContextGoto.cpp b/uppsrc/ide/ContextGoto.cpp index 0d335b693..c3baab3d6 100644 --- a/uppsrc/ide/ContextGoto.cpp +++ b/uppsrc/ide/ContextGoto.cpp @@ -62,8 +62,24 @@ String Ide::GetRefId(int pos, String& name, Point& ref_pos) ci = m.pos.x; } } + AnnotationItem cm = editor.FindCurrentAnnotation(); + if(cm.pos.y == li && cm.pos.x <= lp && cm.pos.x >= ci && cm.name == name) { + ref_id = cm.id; + ref_pos = cm.pos; + } + + if(IsFunction(cm.kind)) + for(const AnnotationItem& m : editor.locals) { + if(m.pos.y == li && m.pos.x <= lp && m.pos.x >= ci && m.name == name) { + ref_id = m.id; + ref_pos = m.pos; + ci = m.pos.x; + } + } + if(ref_id.GetCount()) editor.FromUtf8x(ref_pos); + return ref_id; } diff --git a/uppsrc/ide/ide.key b/uppsrc/ide/ide.key index 8a112de1c..0bb825665 100644 --- a/uppsrc/ide/ide.key +++ b/uppsrc/ide/ide.key @@ -102,8 +102,8 @@ KEY(DCOPY, "Copy as definition/declaration", K_ALT_C) KEY(VIRTUALS, "Virtual methods..", K_ALT_V) KEY(THISBACKS, "Events..", K_ALT_T) KEY(SWAPS, "Go to definition/declaration", K_ALT_I) -KEY(USAGE, "Find current entity usage", K_ALT_U) -KEY(IDUSAGE, "Find symbol usage", K_SHIFT|K_ALT_U) +KEY(IDUSAGE, "Usage", K_ALT_U) +KEY(USAGE, "Usage of current function", K_SHIFT|K_ALT_U) KEY(JUMPS, "Context go to", K_ALT_J) KEY(CLEARMARKERSFILE, "Remove change markers in file", K_ALT_R) KEY(CLEARMARKERSALL, "Remove all change markers", K_SHIFT|K_ALT_R)