X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=engineoutput.c;h=2759aff80b69fd90bfc4c27efdfe0b19018bacaf;hb=18c9024957df2892adb21cd851cb7a27b9502d54;hp=9c493adff4a22d061cfada5f70a13959f95e0a57;hpb=18fe8fec4c8638dccb0c59c781a9ad900ddb3043;p=xboard.git diff --git a/engineoutput.c b/engineoutput.c old mode 100755 new mode 100644 index 9c493ad..2759aff --- a/engineoutput.c +++ b/engineoutput.c @@ -483,13 +483,16 @@ static void UpdateControls( EngineOutputData * ed ) // [HGM] kibitz: write kibitz line; split window for it if necessary void OutputKibitz(int window, char *text) { + static int currentLineEnd[2]; + int where = 0; if(!EngineOutputIsUp()) return; if(!opponentKibitzes) { // on first kibitz of game, clear memos - DoClearMemo(1); - if(gameMode == IcsObserving) DoClearMemo(0); + DoClearMemo(1); currentLineEnd[1] = 0; + if(gameMode == IcsObserving) { DoClearMemo(0); currentLineEnd[0] = 0; } } opponentKibitzes = TRUE; // this causes split window DisplayMode in ICS modes. VerifyDisplayMode(); + strcpy(text+strlen(text)-1, "\r\n"); // to not lose line breaks on copying if(gameMode == IcsObserving) { DoSetWindowText(0, nLabel, gameInfo.white); SetIcon( 0, nColorIcon, nColorWhite); @@ -498,5 +501,8 @@ void OutputKibitz(int window, char *text) DoSetWindowText(1, nLabel, gameMode == IcsPlayingBlack ? gameInfo.white : gameInfo.black); // opponent name SetIcon( 1, nColorIcon, gameMode == IcsPlayingBlack ? nColorWhite : nColorBlack); SetIcon( 1, nStateIcon, nClear); - InsertIntoMemo(window-1, text, 0); // [HGM] multivar: always at top + if(strstr(text, "\\ ") == text) where = currentLineEnd[window-1]; // continuation line +//if(appData.debugMode) fprintf(debugFP, "insert '%s' at %d (end = %d,%d)\n", text, where, currentLineEnd[0], currentLineEnd[1]); + InsertIntoMemo(window-1, text, where); // [HGM] multivar: always at top + currentLineEnd[window-1] = where + strlen(text); }