mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-02 12:30:17 +02:00
* Fix position after Insert
This commit is contained in:
parent
0dcbd253fa
commit
9e086a3de8
@ -275,7 +275,8 @@ end;
|
||||
function TDefaultJSONIndex.Insert(aCurrentIndex, aRecordIndex: Integer
|
||||
): Integer;
|
||||
begin
|
||||
Result:=inherited Insert(aCurrentIndex, aRecordIndex);
|
||||
FList.splice(aCurrentIndex, 0, aRecordIndex);
|
||||
Result:=aCurrentIndex;
|
||||
end;
|
||||
|
||||
function TDefaultJSONIndex.FindRecord(aRecordIndex: Integer): Integer;
|
||||
@ -653,7 +654,7 @@ begin
|
||||
end
|
||||
else // insert
|
||||
begin
|
||||
FDefaultIndex.Insert(FCurrent,Idx);
|
||||
FCurrent:=FDefaultIndex.Insert(FCurrent,Idx);
|
||||
// Must replace this by updating all indexes.
|
||||
// Note that this will change current index.
|
||||
if (FCurrentIndex<>FDefaultIndex) then
|
||||
|
Loading…
Reference in New Issue
Block a user