Print 50-move counter in Engine-Output title
[xboard.git] / history.c
index b6c63ad..6226889 100644 (file)
--- a/history.c
+++ b/history.c
@@ -28,9 +28,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#if HAVE_MALLOC_H
-#include <malloc.h>
-#endif
 #include <string.h>
 
 #include "common.h"
@@ -177,8 +174,7 @@ void MemoContentUpdated()
 {
     int caretPos;
 
-    DoHighlight( lastCurrent, FALSE );
-    DoHighlight( currCurrent, TRUE );
+    if(lastCurrent <= currLast) DoHighlight( lastCurrent, FALSE );
 
     lastFirst = currFirst;
     lastLast = currLast;
@@ -198,6 +194,7 @@ void MemoContentUpdated()
     }
 
     ScrollToCurrent(caretPos);
+    DoHighlight( currCurrent, TRUE ); // [HGM] moved last, because in X some scrolling methods spoil highlighting
 }
 
 // back-end. Must be called as double-click call-back on move-history text edit