From 39dde6cf1364ede1ac66af0e6404095141ac8d81 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 18 Dec 2012 11:51:46 +0000 Subject: [PATCH] IDE: find prompt: shorten texts, bug #23493 git-svn-id: trunk@39575 - --- ide/sourceeditor.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 3f39db46cd..b7dba5da5e 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -2886,6 +2886,16 @@ end; procedure TSourceEditor.OnReplace(Sender: TObject; const ASearch, AReplace: string; Line, Column: integer; var Action: TSynReplaceAction); + + function Shorten(const s: string): string; + const + MAX_LEN=300; + begin + Result:=s; + if Length(Result)>MAX_LEN then + Result:=LeftStr(Result, MAX_LEN)+'...'; + end; + var a,x,y:integer; AText:AnsiString; begin @@ -2896,7 +2906,7 @@ begin CenterCursorHoriz(hcmSoftKeepEOL); AText:=Format(lisUEReplaceThisOccurrenceOfWith, - ['"', ASearch, '"', LineEnding, '"', AReplace, '"']); + ['"', Shorten(ASearch), '"', LineEnding, '"', Shorten(AReplace), '"']); GetDialogPosition(300,150,X,Y); a:=MessageDlgPos(AText,mtconfirmation,