src/Tools/jEdit/src/jedit_editor.scala
changeset 54325 2c4155003352
parent 53845 08721d7b2262
child 54461 6c360a6ade0e
     1.1 --- a/src/Tools/jEdit/src/jedit_editor.scala	Fri Oct 11 12:06:26 2013 +0200
     1.2 +++ b/src/Tools/jEdit/src/jedit_editor.scala	Fri Oct 11 20:45:21 2013 +0200
     1.3 @@ -66,24 +66,21 @@
     1.4    {
     1.5      Swing_Thread.require()
     1.6  
     1.7 -    if (snapshot.is_outdated) None
     1.8 -    else {
     1.9 -      val text_area = view.getTextArea
    1.10 -      PIDE.document_view(text_area) match {
    1.11 -        case Some(doc_view) =>
    1.12 -          val node = snapshot.version.nodes(doc_view.model.node_name)
    1.13 -          val caret = text_area.getCaretPosition
    1.14 -          if (caret < text_area.getBuffer.getLength) {
    1.15 -            val caret_commands = node.command_range(caret)
    1.16 -            if (caret_commands.hasNext) {
    1.17 -              val (cmd0, _) = caret_commands.next
    1.18 -              node.commands.reverse.iterator(cmd0).find(cmd => !cmd.is_ignored)
    1.19 -            }
    1.20 -            else None
    1.21 +    val text_area = view.getTextArea
    1.22 +    PIDE.document_view(text_area) match {
    1.23 +      case Some(doc_view) =>
    1.24 +        val node = snapshot.version.nodes(doc_view.model.node_name)
    1.25 +        val caret = snapshot.revert(text_area.getCaretPosition)
    1.26 +        if (caret < text_area.getBuffer.getLength) {
    1.27 +          val caret_commands = node.command_range(caret)
    1.28 +          if (caret_commands.hasNext) {
    1.29 +            val (cmd0, _) = caret_commands.next
    1.30 +            node.commands.reverse.iterator(cmd0).find(cmd => !cmd.is_ignored)
    1.31            }
    1.32 -          else node.commands.reverse.iterator.find(cmd => !cmd.is_ignored)
    1.33 -        case None => None
    1.34 -      }
    1.35 +          else None
    1.36 +        }
    1.37 +        else node.commands.reverse.iterator.find(cmd => !cmd.is_ignored)
    1.38 +      case None => None
    1.39      }
    1.40    }
    1.41