code: protected void fireInsertUpdate( DocumentEvent evt ) {
  
          super.fireInsertUpdate(evt);
  
          try {
              processChangedLines(evt.getOffset(), evt.getLength());
          } catch (BadLocationException ex) {
              System.out.println("" + ex);
          }
      }
docs: /*
  This updates the colored text and prepares for undo event