equal
deleted
inserted
replaced
155 def command_at(i: Text.Offset): Option[(Command, Text.Offset)] = |
155 def command_at(i: Text.Offset): Option[(Command, Text.Offset)] = |
156 { |
156 { |
157 val range = command_range(i) |
157 val range = command_range(i) |
158 if (range.hasNext) Some(range.next) else None |
158 if (range.hasNext) Some(range.next) else None |
159 } |
159 } |
160 |
|
161 def proper_command_at(i: Text.Offset): Option[Command] = |
|
162 command_at(i) match { |
|
163 case Some((command, _)) => |
|
164 commands.reverse_iterator(command).find(cmd => !cmd.is_ignored) |
|
165 case None => None |
|
166 } |
|
167 |
160 |
168 def command_start(cmd: Command): Option[Text.Offset] = |
161 def command_start(cmd: Command): Option[Text.Offset] = |
169 Node.command_starts(commands.iterator).find(_._1 == cmd).map(_._2) |
162 Node.command_starts(commands.iterator).find(_._1 == cmd).map(_._2) |
170 } |
163 } |
171 |
164 |