more robust: delay switches thread context from timer to GUI and may get out of sync with revoke operation;
--- a/src/Tools/jEdit/src/rich_text_area.scala Thu Jan 12 11:20:40 2017 +0100
+++ b/src/Tools/jEdit/src/rich_text_area.scala Thu Jan 12 12:29:12 2017 +0100
@@ -41,11 +41,13 @@
/* robust extension body */
+ def check_robust_body: Boolean =
+ GUI_Thread.require { buffer == text_area.getBuffer }
+
def robust_body[A](default: A)(body: => A): A =
{
try {
- GUI_Thread.require {}
- if (buffer == text_area.getBuffer) body
+ if (check_robust_body) body
else {
Log.log(Log.ERROR, this, ERROR("Implicit change of text area buffer"))
default
--- a/src/Tools/jEdit/src/text_overview.scala Thu Jan 12 11:20:40 2017 +0100
+++ b/src/Tools/jEdit/src/text_overview.scala Thu Jan 12 12:29:12 2017 +0100
@@ -115,7 +115,8 @@
private val delay_refresh =
GUI_Thread.delay_first(PIDE.options.seconds("editor_update_delay")) {
- doc_view.rich_text_area.robust_body(()) {
+ if (!doc_view.rich_text_area.check_robust_body) invoke()
+ else {
JEdit_Lib.buffer_lock(buffer) {
val rendering = doc_view.get_rendering()
val overview = get_overview()