429 consolidate_spans(resources, syntax, doc_blobs, reparse_limit, |
429 consolidate_spans(resources, syntax, doc_blobs, reparse_limit, |
430 name, visible, node.commands)) |
430 name, visible, node.commands)) |
431 } |
431 } |
432 } |
432 } |
433 |
433 |
434 def text_edits( |
434 def parse_edits( |
435 resources: Resources, |
435 resources: Resources, |
436 reparse_limit: Int, |
436 reparse_limit: Int, |
437 previous: Document.Version, |
437 previous: Document.Version, |
438 doc_blobs: Document.Blobs, |
438 doc_blobs: Document.Blobs, |
439 edits: List[Document.Edit_Text]) |
439 edits: List[Document.Edit_Text]): Session.Change = |
440 : (Boolean, List[Document.Edit_Command], Document.Version) = |
|
441 { |
440 { |
442 val ((syntax, syntax_changed), reparse0, nodes0, doc_edits0) = |
441 val ((syntax, syntax_changed), reparse0, nodes0, doc_edits0) = |
443 header_edits(resources.base_syntax, previous, edits) |
442 header_edits(resources.base_syntax, previous, edits) |
444 |
443 |
445 if (edits.isEmpty) |
444 if (edits.isEmpty) |
446 (false, Nil, Document.Version.make(syntax, previous.nodes)) |
445 Session.Change(previous, doc_blobs, false, Nil, Document.Version.make(syntax, previous.nodes)) |
447 else { |
446 else { |
448 val reparse = |
447 val reparse = |
449 (reparse0 /: nodes0.entries)({ |
448 (reparse0 /: nodes0.entries)({ |
450 case (reparse, (name, node)) => |
449 case (reparse, (name, node)) => |
451 if (node.load_commands.exists(_.blobs_changed(doc_blobs))) |
450 if (node.load_commands.exists(_.blobs_changed(doc_blobs))) |