Changeset 223


Ignore:
Timestamp:
11/10/02 01:01:04 (21 years ago)
Author:
piso
Message:

findTag(): try to get a unique match by just considering methods and explicit
tags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/FindTagTextFieldHandler.java

    r2 r223  
    6464        if (tags != null) {
    6565            if (tags.size() > 1) {
     66                // Can we get a unique match if we just consider methods and
     67                // explicit tags?
     68                ArrayList shortList = new ArrayList();
     69                for (Iterator it = tags.iterator(); it.hasNext();) {
     70                    Tag tag = (Tag) it.next();
     71                    if (tag instanceof LocalTag) {
     72                        int type = ((LocalTag)tag).getType();
     73                        if (type == TAG_METHOD || type == TAG_EXPLICIT)
     74                            shortList.add(tag);
     75                    }
     76                }
     77                if (shortList.size() == 1)
     78                    tags = shortList;
     79            }
     80            if (tags.size() > 1) {
    6681                editor.setDefaultCursor();
    67                 ListTagsBuffer buf = new ListTagsBuffer(editor, "findTag", pattern, tags);
     82                ListTagsBuffer buf =
     83                    new ListTagsBuffer(editor, "findTag", pattern, tags);
    6884                editor.makeNext(buf);
    6985                Editor ed = editor.activateInOtherWindow(buf);
Note: See TracChangeset for help on using the changeset viewer.