clarified operation (without change of signature!);
authorwenzelm
Mon, 30 Jan 2023 16:20:17 +0100
changeset 77142 139a0119ae3c
parent 77137 79231a210f5d
child 77143 61f6bb753cbf
clarified operation (without change of signature!);
src/Pure/PIDE/editor.scala
src/Tools/jEdit/src/document_dockable.scala
--- a/src/Pure/PIDE/editor.scala	Mon Jan 30 15:02:38 2023 +0100
+++ b/src/Pure/PIDE/editor.scala	Mon Jan 30 16:20:17 2023 +0100
@@ -37,7 +37,8 @@
     if (changed) document_state_changed()
   }
 
-  def document_session(): Option[Sessions.Background] = document_state().session_background
+  def document_session(): Option[Sessions.Background] =
+    document_state().session_background.filter(_.info.documents.nonEmpty)
 
   def document_required(): List[Document.Node.Name] = {
     val st = document_state()
--- a/src/Tools/jEdit/src/document_dockable.scala	Mon Jan 30 15:02:38 2023 +0100
+++ b/src/Tools/jEdit/src/document_dockable.scala	Mon Jan 30 16:20:17 2023 +0100
@@ -225,7 +225,7 @@
 
   private def build_document(): Unit = {
     PIDE.editor.document_session() match {
-      case Some(session_background) if session_background.info.documents.nonEmpty =>
+      case Some(session_background) =>
         run_process(only_running = true) { progress =>
           show_page(output_page)
           val result = Exn.capture { document_build(session_background, progress) }
@@ -246,7 +246,7 @@
           show_state()
           show_page(if (Exn.is_interrupt_exn(result)) input_page else output_page)
         }
-      case _ =>
+      case None =>
     }
   }