src/Tools/jEdit/src/jedit/document_model.scala
changeset 38426 2858ec7b6dd8
parent 38425 e467db701d78
child 38427 7066fbd315ae
     1.1 --- a/src/Tools/jEdit/src/jedit/document_model.scala	Sun Aug 15 21:42:13 2010 +0200
     1.2 +++ b/src/Tools/jEdit/src/jedit/document_model.scala	Sun Aug 15 22:48:56 2010 +0200
     1.3 @@ -186,7 +186,7 @@
     1.4  
     1.5    // simplify slightly odd result of TextArea.getLineEndOffset
     1.6    // NB: jEdit already normalizes \r\n and \r to \n
     1.7 -  def visible_line_end(start: Int, end: Int): Int =
     1.8 +  def visible_line_end(start: Text.Offset, end: Text.Offset): Text.Offset =
     1.9    {
    1.10      val end1 = end - 1
    1.11      if (start <= end1 && end1 < buffer.getLength &&
    1.12 @@ -243,9 +243,9 @@
    1.13      }
    1.14  
    1.15      override def preContentRemoved(buffer: JEditBuffer,
    1.16 -      start_line: Int, start: Int, num_lines: Int, removed_length: Int)
    1.17 +      start_line: Int, offset: Int, num_lines: Int, removed_length: Int)
    1.18      {
    1.19 -      pending_edits += Text.Edit.remove(start, buffer.getText(start, removed_length))
    1.20 +      pending_edits += Text.Edit.remove(offset, buffer.getText(offset, removed_length))
    1.21      }
    1.22    }
    1.23  
    1.24 @@ -272,7 +272,7 @@
    1.25          Document_View(text_area).get.set_styles()
    1.26        */
    1.27  
    1.28 -      def handle_token(style: Byte, offset: Int, length: Int) =
    1.29 +      def handle_token(style: Byte, offset: Text.Offset, length: Int) =
    1.30          handler.handleToken(line_segment, style, offset, length, context)
    1.31  
    1.32        var next_x = start
    1.33 @@ -280,8 +280,8 @@
    1.34          (command, command_start) <-
    1.35            snapshot.node.command_range(snapshot.revert(start), snapshot.revert(stop))
    1.36          markup <- snapshot.state(command).highlight.flatten
    1.37 -        val abs_start = snapshot.convert(command_start + markup.start)
    1.38 -        val abs_stop = snapshot.convert(command_start + markup.stop)
    1.39 +        val abs_start = snapshot.convert(command_start + markup.range.start)
    1.40 +        val abs_stop = snapshot.convert(command_start + markup.range.stop)
    1.41          if (abs_stop > start)
    1.42          if (abs_start < stop)
    1.43          val token_start = (abs_start - start) max 0