357 for { |
357 for { |
358 r1 <- rendering.text_color(chunk_range, chunk_color) |
358 r1 <- rendering.text_color(chunk_range, chunk_color) |
359 r2 <- r1.try_restrict(chunk_range) |
359 r2 <- r1.try_restrict(chunk_range) |
360 } yield r2 |
360 } yield r2 |
361 |
361 |
362 val padded_markup = |
362 val padded_markup_iterator = |
363 if (markup.isEmpty) |
363 if (markup.isEmpty) |
364 Iterator(Text.Info(chunk_range, chunk_color)) |
364 Iterator(Text.Info(chunk_range, chunk_color)) |
365 else |
365 else |
366 Iterator( |
366 Iterator( |
367 Text.Info(Text.Range(chunk_range.start, markup.head.range.start), chunk_color)) ++ |
367 Text.Info(Text.Range(chunk_range.start, markup.head.range.start), chunk_color)) ++ |
368 markup.iterator ++ |
368 markup.iterator ++ |
369 Iterator(Text.Info(Text.Range(markup.last.range.stop, chunk_range.stop), chunk_color)) |
369 Iterator(Text.Info(Text.Range(markup.last.range.stop, chunk_range.stop), chunk_color)) |
370 |
370 |
371 var x1 = x + w |
371 var x1 = x + w |
372 gfx.setFont(chunk_font) |
372 gfx.setFont(chunk_font) |
373 for (Text.Info(range, color) <- padded_markup if !range.is_singularity) { |
373 for (Text.Info(range, color) <- padded_markup_iterator if !range.is_singularity) { |
374 val str = chunk_str.substring(range.start - chunk_offset, range.stop - chunk_offset) |
374 val str = chunk_str.substring(range.start - chunk_offset, range.stop - chunk_offset) |
375 gfx.setColor(color) |
375 gfx.setColor(color) |
376 |
376 |
377 range.try_restrict(caret_range) match { |
377 range.try_restrict(caret_range) match { |
378 case Some(r) if !r.is_singularity => |
378 case Some(r) if !r.is_singularity => |