src/Tools/jEdit/src/rich_text_area.scala
changeset 56884 7de69b35bdaf
parent 56883 38c6b70e5e53
child 57612 990ffb84489b
equal deleted inserted replaced
56883:38c6b70e5e53 56884:7de69b35bdaf
   275       robust_rendering { rendering =>
   275       robust_rendering { rendering =>
   276         val fm = text_area.getPainter.getFontMetrics
   276         val fm = text_area.getPainter.getFontMetrics
   277 
   277 
   278         for (i <- 0 until physical_lines.length) {
   278         for (i <- 0 until physical_lines.length) {
   279           if (physical_lines(i) != -1) {
   279           if (physical_lines(i) != -1) {
   280             val line_range = Text.Range(start(i), end(i))
   280             val line_range = Text.Range(start(i), end(i) min buffer.getLength)
   281 
   281 
   282             // line background color
   282             // line background color
   283             for { (color, separator) <- rendering.line_background(line_range) }
   283             for { (color, separator) <- rendering.line_background(line_range) }
   284             {
   284             {
   285               gfx.setColor(color)
   285               gfx.setColor(color)
   454         }
   454         }
   455 
   455 
   456         for (i <- 0 until physical_lines.length) {
   456         for (i <- 0 until physical_lines.length) {
   457           val line = physical_lines(i)
   457           val line = physical_lines(i)
   458           if (line != -1) {
   458           if (line != -1) {
   459             val line_range = Text.Range(start(i), end(i))
   459             val line_range = Text.Range(start(i), end(i) min buffer.getLength)
   460 
   460 
   461             // bullet bar
   461             // bullet bar
   462             for {
   462             for {
   463               Text.Info(range, color) <- rendering.bullet(line_range)
   463               Text.Info(range, color) <- rendering.bullet(line_range)
   464               r <- JEdit_Lib.gfx_range(text_area, range)
   464               r <- JEdit_Lib.gfx_range(text_area, range)
   499     {
   499     {
   500       robust_rendering { rendering =>
   500       robust_rendering { rendering =>
   501         val search_pattern = get_search_pattern()
   501         val search_pattern = get_search_pattern()
   502         for (i <- 0 until physical_lines.length) {
   502         for (i <- 0 until physical_lines.length) {
   503           if (physical_lines(i) != -1) {
   503           if (physical_lines(i) != -1) {
   504             val line_range = Text.Range(start(i), end(i))
   504             val line_range = Text.Range(start(i), end(i) min buffer.getLength)
   505 
   505 
   506             // foreground color
   506             // foreground color
   507             for {
   507             for {
   508               Text.Info(range, color) <- rendering.foreground(line_range)
   508               Text.Info(range, color) <- rendering.foreground(line_range)
   509               r <- JEdit_Lib.gfx_range(text_area, range)
   509               r <- JEdit_Lib.gfx_range(text_area, range)