Changeset 1162


Ignore:
Timestamp:
Jul 4, 2011, 6:45:15 PM (6 years ago)
Author:
stefan
Message:

improved style of error list and implemented continuing comments

Location:
trunk/src/jlatexeditor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/ErrorView.java

    r1139 r1162  
    129129  public void update() {
    130130    nodeError.update();
    131     //nodeError.setUserObject("<html><font color=\"" + (lmError.getSize() > 0 ? "red" : "gray") + "\">errors (" + lmError.getSize() + ")</font></html>");
    132     nodeHbox.setUserObject("<html><font color=\"" + (lmHbox.getSize() > 0 ? "black" : "gray") + "\">overfull hboxes (" + lmHbox.getSize() + ")</font></html>");
    133     nodeWarning.setUserObject("<html><font color=\"" + (lmWarning.getSize() > 0 ? "black" : "gray") + "\">warnings (" + lmWarning.getSize() + ")</font></html>");
    134     nodeWarningCitation.setUserObject("<html><font color=\"" + (lmWarningCitation.getSize() > 0 ? "black" : "gray") + "\">citations (" + lmWarningCitation.getSize() + ")</font></html>");
    135     nodeWarningReference.setUserObject("<html><font color=\"" + (lmWarningReference.getSize() > 0 ? "black" : "gray") + "\">references (" + lmWarningReference.getSize() + ")</font></html>");
     131    nodeHbox.update();
     132    nodeWarning.update();
     133    nodeWarningCitation.update();
     134    nodeWarningReference.update();
    136135  }
    137136
  • trunk/src/jlatexeditor/codehelper/LatexLineBreakListener.java

    r1154 r1162  
    2121    SCEDocument doc = pane.getDocument();
    2222    SCECaret caret = pane.getCaret();
    23     int row = caret.getRow();
     23    int rowNr = caret.getRow();
    2424
    25     if (row > 0) {
    26       String lastLine = doc.getRowsModel().getRowAsString(row - 1);
     25    if (rowNr > 0) {
     26      String lastLine = doc.getRowsModel().getRowAsString(rowNr - 1);
    2727      boolean indent = false;
    2828      boolean closeEnv = false;
    2929      String envName = null;
    3030
    31       // determine if a new environment was opened in the last row
     31      // determine if last line is a comment
     32      if (lastLine.startsWith("%")) {
     33        if (GProperties.getBoolean("editor.auto_continue_comment")) {
     34          pane.insert("% ");
     35        }
     36      }
     37      // determine if a new environment was opened in the last line
    3238      Iterator<WordWithPos> openEnvIterator = EnvironmentUtils.getOpenEnvIterator(pane);
    3339      if (openEnvIterator.hasNext()) {
    3440        WordWithPos openEnvWord = openEnvIterator.next();
    35         if (openEnvWord.getStartRow() == row - 1) {
     41        if (openEnvWord.getStartRow() == rowNr - 1) {
    3642          indent   = GProperties.getBoolean("editor.auto_indentation.after_begin");
    3743          closeEnv = GProperties.getBoolean("editor.auto_close_environment");
     
    5258      // check further if we need to indent the new line
    5359      if (!indent && GProperties.getBoolean("editor.auto_indentation.after_item")) {
    54         // indent if a new item was started in the last row
     60        // indent if a new item was started in the last line
    5561        indent = itemPattern.matcher(lastLine).find();
    5662      }
     
    7480      if (closeEnv) {
    7581        SCEPosition oldPos = new SCEDocumentPosition(caret.getRow(), caret.getColumn());
    76         String currLine = doc.getRowsModel().getRowAsString(row);
     82        String currLine = doc.getRowsModel().getRowAsString(rowNr);
    7783        String nextIndentation = currLine.substring(0, Math.max(0, currLine.length() - 2));
    7884        pane.insert("\n" + nextIndentation + "\\end{" + envName + '}');
  • trunk/src/jlatexeditor/errorhighlighting/LatexCompileError.java

    r1110 r1162  
    113113
    114114  public String toString() {
    115     StringBuffer message = new StringBuffer(getFileName()).append(": ");
     115    StringBuilder message = new StringBuilder("<font color=\"#000000\">").append(getFileName()).append("</font><font color=\"gray\">: ");
    116116    if (getLineStart() != -1) {
    117117      message.append(getLineStart());
    118118      if (getLineStart() != getLineEnd()) message.append("--").append(getLineEnd());
    119119    }
    120     message.append("\n");
    121     message.append("  ").append(getMessage()).append("\n");
     120    message.append("</font>\n");
     121    message.append("  <font color=\"#9a6634\">").append(getMessage()).append("</font>\n");
    122122    if (getTextBefore() != null) {
    123       message.append("  ").append(getTextBefore()).append("[ERROR]").append(getTextAfter()).append("\n");
     123      message.append("  ").append(getTextBefore()).append("<font color=\"red\">[ERROR]</font>").append(getTextAfter()).append("\n");
    124124    }
    125125    return message.toString();
  • trunk/src/jlatexeditor/gproperties/GProperties.java

    r1149 r1162  
    121121    properties.addEntry(new Def("editor.auto_completion.delay", INT_GT_0, "200"));
    122122    properties.addEntry(new Def("editor.auto_close_environment", BOOLEAN, "true"));
     123    properties.addEntry(new Def("editor.auto_continue_comment", BOOLEAN, "true"));
    123124    properties.addEntry(new Comment(" Automatic indentation"));
    124125    properties.addEntry(new Def("editor.auto_indentation.after_begin", BOOLEAN, "true"));
Note: See TracChangeset for help on using the changeset viewer.