Changeset 1449


Ignore:
Timestamp:
May 11, 2012, 9:46:05 PM (5 years ago)
Author:
joerg
Message:

fix in the unfolding of @string constants

Location:
trunk/src/jlatexeditor/bib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/bib/BibAssistant.java

    r1448 r1449  
    270270    builder.append(year);
    271271
    272     return builder.toString();
     272    return builder.toString().trim();
    273273  }
    274274
     
    478478
    479479      StringBuilder builder = new StringBuilder();
    480       builder.append("@").append(entry.getType(false));
     480      builder.append("@").append(entry.getType(false).toLowerCase());
    481481      builder.append("{").append(entry.getName()).append(",\n");
    482482      for(String akey : keyOrder) {
     
    532532      if(v.startsWith("\"") || v.startsWith("{")) {
    533533        builder.append("{").append(v.substring(1,v.length()-1)).append("}");
     534      } else
     535      if(v.isEmpty() || Character.isDigit(v.charAt(0))) {
     536        builder.append("{").append(v).append("}");
    534537      } else {
    535538        builder.append(v.toLowerCase());
  • trunk/src/jlatexeditor/bib/BibSyntaxHighlighting.java

    r1446 r1449  
    218218
    219219      // closing bracket
    220       if(c == '}' && state.getState() != BibParserState.STATE_VALUE_QUOTED) {
     220      if(c == '}'
     221              && state.getState() != BibParserState.STATE_VALUE_QUOTED
     222              && state.getState() !=  BibParserState.STATE_VALUE_BASIC) {
    221223        sce_char.style = stateStyles[LatexStyles.BRACKET];
    222224
     
    427429        sce_char.style = stateStyles[LatexStyles.TEXT];
    428430
    429         if(c == ',' || c == ' ') {
     431        if(c == ',' || c == ' ' || c == '}') {
    430432          SCEDocumentPosition start = state.getValueOpening();
    431433          SCEDocumentPosition end = new SCEDocumentPosition(sce_char);
    432434          String text = document != null ? document.getText(start, end) : "";
    433           state.getValue().addValue(new WordWithPos(text, start, end));
    434 
    435           if(c == ',') char_nr--;
     435          state.getValue().addValue(new WordWithPos(text.trim(), start, end));
     436
     437          if(c == ',' || c == '}') char_nr--;
    436438          state.setState(BibParserState.STATE_EXPECT_COMMA);
    437439          continue;
Note: See TracChangeset for help on using the changeset viewer.