equal
deleted
inserted
replaced
550 (if (is_outdated) ", outdated" else "") + ")" |
550 (if (is_outdated) ", outdated" else "") + ")" |
551 |
551 |
552 |
552 |
553 /* nodes */ |
553 /* nodes */ |
554 |
554 |
555 val node: Node = version.nodes(node_name) |
555 def get_node(name: Node.Name): Node = version.nodes(name) |
|
556 |
|
557 val node: Node = get_node(node_name) |
556 |
558 |
557 def node_files: List[Node.Name] = |
559 def node_files: List[Node.Name] = |
558 node_name :: (node.load_commands ::: snippet_command.toList).flatMap(_.blobs_names) |
560 node_name :: (node.load_commands ::: snippet_command.toList).flatMap(_.blobs_names) |
559 |
561 |
560 |
562 |
659 def find_command(id: Document_ID.Generic): Option[(Node, Command)] = |
661 def find_command(id: Document_ID.Generic): Option[(Node, Command)] = |
660 state.lookup_id(id) match { |
662 state.lookup_id(id) match { |
661 case None => None |
663 case None => None |
662 case Some(st) => |
664 case Some(st) => |
663 val command = st.command |
665 val command = st.command |
664 val node = version.nodes(command.node_name) |
666 val command_node = get_node(command.node_name) |
665 if (node.commands.contains(command)) Some((node, command)) else None |
667 if (command_node.commands.contains(command)) Some((command_node, command)) else None |
666 } |
668 } |
667 |
669 |
668 def find_command_position(id: Document_ID.Generic, offset: Symbol.Offset) |
670 def find_command_position(id: Document_ID.Generic, offset: Symbol.Offset) |
669 : Option[Line.Node_Position] = |
671 : Option[Line.Node_Position] = |
670 for ((node, command) <- find_command(id)) |
672 for ((node, command) <- find_command(id)) |
678 Line.Node_Position(name, pos) |
680 Line.Node_Position(name, pos) |
679 } |
681 } |
680 |
682 |
681 def current_command(other_node_name: Node.Name, offset: Text.Offset): Option[Command] = |
683 def current_command(other_node_name: Node.Name, offset: Text.Offset): Option[Command] = |
682 if (other_node_name.is_theory) { |
684 if (other_node_name.is_theory) { |
683 val other_node = version.nodes(other_node_name) |
685 val other_node = get_node(other_node_name) |
684 val iterator = other_node.command_iterator(revert(offset) max 0) |
686 val iterator = other_node.command_iterator(revert(offset) max 0) |
685 if (iterator.hasNext) { |
687 if (iterator.hasNext) { |
686 val (command0, _) = iterator.next |
688 val (command0, _) = iterator.next |
687 other_node.commands.reverse.iterator(command0).find(command => !command.is_ignored) |
689 other_node.commands.reverse.iterator(command0).find(command => !command.is_ignored) |
688 } |
690 } |
703 |
705 |
704 |
706 |
705 /* command ids: static and dynamic */ |
707 /* command ids: static and dynamic */ |
706 |
708 |
707 def command_id_map: Map[Document_ID.Generic, Command] = |
709 def command_id_map: Map[Document_ID.Generic, Command] = |
708 state.command_id_map(version, version.nodes(node_name).commands) |
710 state.command_id_map(version, get_node(node_name).commands) |
709 |
711 |
710 |
712 |
711 /* cumulate markup */ |
713 /* cumulate markup */ |
712 |
714 |
713 def cumulate[A]( |
715 def cumulate[A]( |