Commits

Anonymous committed a814460

Fixed logged error, when presentation started more than once (e.g. when calling (in-package ...)

  • Participants
  • Parent commits 59494a5

Comments (0)

Files changed (1)

org.lispdev.swank/src/org/lispdev/swank/SwankInterfaceCore.java

    * presentation start and presentation end.
    */
   private String presentation = null;
+  /**
+   * Keeps number of time presentation start was called, but not finished.
+   */
+  private int npresentation = 0;
 
   synchronized private void signalListeners(LispNode result, SwankEvent event)
   {
     switch(event)
     {
       case PRESENTATION_START:
-        presentation = result.get(1).value;
+        // sometimes same presentation started and ended twice (e.g. when
+        // changing package
+        ++npresentation;
+        if( presentation != null )
+        {
+          if( !presentation.equals(result.get(1).value) )
+          {
+            Log.logError("Encountered nested presentation");
+          }
+        }
+        else
+        {
+          presentation = result.get(1).value;
+        }
         return;
       case PRESENTATION_END:
         if( !result.get(1).value.equals(presentation) )
         {
           Log.logError("Presentation end is different from presentation start");
         }
-        presentation = null;
+        --npresentation;
+        if( npresentation == 0 ) presentation = null;
         return;
       case WRITE_STRING:
         if( presentation != null )