#include <stdio.h>
#include <stdlib.h>
-#include <malloc.h>
#include <string.h>
#include "common.h"
static int lastFirst = 0;
static int lastLast = 0;
static int lastCurrent = -1;
+static int lastGames;
static char lastLastMove[ MOVE_LEN ];
currFirst == lastFirst &&
currLast == lastLast &&
currCurrent >= 0 &&
- TRUE )
+ lastGames == storedGames )
{
result = TRUE;
lastLast == (currLast-1) &&
lastCurrent == (currCurrent-1) &&
currCurrent == (currLast-1) &&
- TRUE )
+ lastGames == storedGames )
{
result = TRUE;
}
}
/* Move text */
- strcpy( buf, SavePart( currMovelist[index] ) );
+ safeStrCpy( buf, SavePart( currMovelist[index]) , sizeof( buf)/sizeof( buf[0]) );
strcat( buf, " " );
histMoves[index].memoOffset = AppendToHistoryMemo( buf, 0, 0 );
{
int caretPos;
- DoHighlight( lastCurrent, FALSE );
- DoHighlight( currCurrent, TRUE );
+ if(lastCurrent <= currLast) DoHighlight( lastCurrent, FALSE );
lastFirst = currFirst;
lastLast = currLast;
lastCurrent = currCurrent;
+ lastGames = storedGames;
lastLastMove[0] = '\0';
if( lastLast > 0 ) {
- strcpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) );
+ safeStrCpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) , sizeof( lastLastMove)/sizeof( lastLastMove[0]) );
}
/* Deselect any text, move caret to end of memo */
}
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