def invoke(): Unit = delay_refresh.invoke() def revoke(): Unit = { delay_refresh.revoke(); future_refresh.change { x => x.cancel(); x } }
privateval delay_refresh =
Delay.first(PIDE.session.update_delay, gui = true) { if (!doc_view.rich_text_area.check_robust_body) invoke() else {
JEdit_Lib.buffer_lock(buffer) { val rendering = Document_View.rendering(doc_view) val overview = get_overview()
if (rendering.snapshot.is_outdated || is_running()) invoke() else { val line_offsets = { val line_manager = JEdit_Lib.buffer_line_manager(buffer) val a = new Array[Int](line_manager.getLineCount) for (i <- 1 until a.length) a(i) = line_manager.getLineEndOffset(i - 1)
a
}
future_refresh.change(_ =>
Future.fork { val line_count = overview.line_count val char_count = overview.char_count val L = overview.L val H = overview.H
if (l < line_count && h < H) { val p1 = p + H val q1 = q + HEIGHT * L val (l1, h1) = if (p1 >= q1) (l + 1, h + (p1 - q) / L) else (l + (q1 - p) / H, h + HEIGHT)
val start = line_offsets(l) val end = if (l1 < line_count) line_offsets(l1) else char_count
val colors1 =
(rendering.overview_color(Text.Range(start, end)), colors) match { case (Some(color), (old_color, old_h, old_h1) :: rest) if color == old_color && old_h1 == h => (color, old_h, h1) :: rest case (Some(color), _) => (color, h, h1) :: colors case (None, _) => colors
}
loop(l1, h1, p + (l1 - l) * H, q + (h1 - h) * L, colors1)
} else colors.reverse
} val new_colors = loop(0, 0, 0, 0, Nil)
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.6Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.