mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 11:49:24 +02:00
SynEdit: SyncronEdit: made ProcessMessages interval time based instead of words-processed count. Better responsiveness on not so fast pc. Added idle calls
git-svn-id: trunk@21330 -
This commit is contained in:
parent
14b771a34e
commit
25d1bbf7ec
@ -282,7 +282,8 @@ var
|
|||||||
const
|
const
|
||||||
MAX_CACHE = 50; // Amount of lower-cased lines cached
|
MAX_CACHE = 50; // Amount of lower-cased lines cached
|
||||||
MAX_SYNC_ED_WORDS = 50;// 250;
|
MAX_SYNC_ED_WORDS = 50;// 250;
|
||||||
MAX_WORDS_PER_SCAN = 50000;
|
MAX_WORDS_PER_SCAN = 5000;
|
||||||
|
MIN_PROCESS_MSG_TIME = (1/86400)/15;
|
||||||
|
|
||||||
Operator = (P1, P2 : TPoint) : Boolean;
|
Operator = (P1, P2 : TPoint) : Boolean;
|
||||||
begin
|
begin
|
||||||
@ -1119,7 +1120,9 @@ var
|
|||||||
|
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
|
StartTime, t: Double;
|
||||||
begin
|
begin
|
||||||
|
StartTime := now();
|
||||||
while (FCallQueued) and (FMode = spseSelecting) do begin
|
while (FCallQueued) and (FMode = spseSelecting) do begin
|
||||||
FCallQueued := False;
|
FCallQueued := False;
|
||||||
FWordScanCount := 0;
|
FWordScanCount := 0;
|
||||||
@ -1178,7 +1181,12 @@ begin
|
|||||||
|
|
||||||
if FWordScanCount > MAX_WORDS_PER_SCAN then begin
|
if FWordScanCount > MAX_WORDS_PER_SCAN then begin
|
||||||
FCallQueued := True;
|
FCallQueued := True;
|
||||||
Application.ProcessMessages;
|
t := Now;
|
||||||
|
if (t - StartTime > MIN_PROCESS_MSG_TIME) then begin
|
||||||
|
Application.ProcessMessages;
|
||||||
|
Application.Idle(False);
|
||||||
|
StartTime := t;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
FCallQueued := False;
|
FCallQueued := False;
|
||||||
|
Loading…
Reference in New Issue
Block a user