X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwhistory.c;h=bab9332b9271083356f0fcd1f51b819251f394a9;hb=29df666d997ad990de5376c962b154b26eb73f2f;hp=ba69a63c7873a5f1937b41f81f637ad8ce8cf1b4;hpb=2380bd9a886c088ba6040d99932c20cdf080fbbb;p=xboard.git diff --git a/winboard/whistory.c b/winboard/whistory.c index ba69a63..bab9332 100644 --- a/winboard/whistory.c +++ b/winboard/whistory.c @@ -1,7 +1,7 @@ /* * Move history for WinBoard * - * Author: Alessandro Scotti + * Author: Alessandro Scotti (Dec 2005) * * ------------------------------------------------------------------------ * This program is free software; you can redistribute it and/or modify @@ -60,6 +60,8 @@ static int lastFirst = 0; static int lastLast = 0; static int lastCurrent = -1; +static char lastLastMove[ MOVE_LEN ]; + static MoveHistoryString * currMovelist; static ChessProgramStats_Move * currPvInfo; static int currFirst = 0; @@ -125,6 +127,13 @@ static BOOL OnlyCurrentPositionChanged() TRUE ) { result = TRUE; + + /* Special case: last move changed */ + if( currCurrent == currLast-1 ) { + if( strcmp( currMovelist[currCurrent], lastLastMove ) != 0 ) { + result = FALSE; + } + } } return result; @@ -214,7 +223,7 @@ static VOID AppendMoveToMemo( int index ) /* PV info (if any) */ if( appData.showEvalInMoveHistory && currPvInfo[index].depth > 0 ) { - sprintf( buf, "%{%s%.2f/%d} ", + sprintf( buf, "{%s%.2f/%d} ", currPvInfo[index].score >= 0 ? "+" : "", currPvInfo[index].score / 100.0, currPvInfo[index].depth ); @@ -245,6 +254,11 @@ static void MemoContentUpdated() lastFirst = currFirst; lastLast = currLast; lastCurrent = currCurrent; + lastLastMove[0] = '\0'; + + if( lastLast > 0 ) { + strcpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) ); + } /* Deselect any text, move caret to end of memo */ if( currCurrent >= 0 ) {