Changeset 1248


Ignore:
Timestamp:
Jul 22, 2011, 12:14:06 PM (6 years ago)
Author:
stefan
Message:

improves completion

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/codehelper/CommandsCodeHelper.java

    r1246 r1248  
    102102    );
    103103
    104     String maxPrefix = search;
     104    String maxPrefix = null;
    105105    for (AbstractTrie<? extends Object> trie : tries) {
    106106      String maxCommonPrefix = trie.getMaxCommonPrefix(search);
     
    112112        }
    113113      }
     114    }
     115    if (maxPrefix == null) {
     116      maxPrefix = search;
    114117    }
    115118
  • trunk/src/jlatexeditor/codehelper/EnvironmentCodeHelper.java

    r1246 r1248  
    7171    );
    7272
    73     String maxPrefix = search;
     73    String maxPrefix = null;
    7474    for (AbstractTrie<? extends Object> trie : tries) {
    7575      String maxCommonPrefix = trie.getMaxCommonPrefix(search);
     
    8282      }
    8383    }
     84    if (maxPrefix == null) {
     85      maxPrefix = search;
     86    }
    8487
    8588    return maxPrefix;
  • trunk/src/sce/codehelper/CodeHelperPane.java

    r1247 r1248  
    181181    if (wordPos == null || codeHelper == null) return;
    182182
    183     status.setText("Level " + level);
    184 
    185183    // get selection
    186184    Object selectedValue = null;
     
    191189
    192190    if (codeHelper.documentChanged()) {
    193       for (CHCommand command : codeHelper.getCompletions(level)) model.addElement(command);
     191      while (model.isEmpty()) {
     192        for (CHCommand command : codeHelper.getCompletions(level)) model.addElement(command);
     193        if (model.isEmpty()) {
     194          if (level >= 3) {
     195            break;
     196          }
     197          level++;
     198        }
     199      }
     200
     201      status.setText("Level " + level);
    194202      if (model.isEmpty()) {
    195203        status.setText(status.getText() + " - no suggestions");
Note: See TracChangeset for help on using the changeset viewer.