src/Pure/PIDE/headless.scala
changeset 76312 5f6c43eeff90
parent 76311 fab6568b119d
child 76313 f67e8a557b7d
equal deleted inserted replaced
76311:fab6568b119d 76312:5f6c43eeff90
   436       }
   436       }
   437 
   437 
   438       def purge_edits: List[Document.Edit_Text] =
   438       def purge_edits: List[Document.Edit_Text] =
   439         make_edits(Text.Edit.removes(0, text))
   439         make_edits(Text.Edit.removes(0, text))
   440 
   440 
   441       def required(required: Boolean): Theory =
   441       def set_required(required: Boolean): Theory =
   442         if (required == node_required) this
   442         if (required == node_required) this
   443         else new Theory(node_name, node_header, text, required)
   443         else new Theory(node_name, node_header, text, required)
   444     }
   444     }
   445 
   445 
   446     sealed case class State(
   446     sealed case class State(
   524           for {
   524           for {
   525             node_name <- theories
   525             node_name <- theories
   526             theory <- st1.theories.get(node_name)
   526             theory <- st1.theories.get(node_name)
   527           }
   527           }
   528           yield {
   528           yield {
   529             val theory1 = theory.required(st1.is_required(node_name))
   529             val theory1 = theory.set_required(st1.is_required(node_name))
   530             val edits = theory1.node_edits(Some(theory))
   530             val edits = theory1.node_edits(Some(theory))
   531             (edits, (node_name, theory1))
   531             (edits, (node_name, theory1))
   532           }
   532           }
   533         (theory_edits.flatMap(_._1), st1.update_theories(theory_edits.map(_._2)))
   533         (theory_edits.flatMap(_._1), st1.update_theories(theory_edits.map(_._2)))
   534       }
   534       }
   611         val (doc_blobs1, st1) = st.insert_required(id, theories).update_blobs(files)
   611         val (doc_blobs1, st1) = st.insert_required(id, theories).update_blobs(files)
   612         val theory_edits =
   612         val theory_edits =
   613           for (theory <- loaded_theories)
   613           for (theory <- loaded_theories)
   614           yield {
   614           yield {
   615             val node_name = theory.node_name
   615             val node_name = theory.node_name
   616             val theory1 = theory.required(st1.is_required(node_name))
   616             val theory1 = theory.set_required(st1.is_required(node_name))
   617             val edits = theory1.node_edits(st1.theories.get(node_name))
   617             val edits = theory1.node_edits(st1.theories.get(node_name))
   618             (edits, (node_name, theory1))
   618             (edits, (node_name, theory1))
   619           }
   619           }
   620         val file_edits =
   620         val file_edits =
   621           for { node_name <- files if doc_blobs1.changed(node_name) }
   621           for { node_name <- files if doc_blobs1.changed(node_name) }