* Optimize changing visual content

git-svn-id: trunk@62331 -
This commit is contained in:
michael 2019-12-06 10:22:27 +00:00
parent 0586de550a
commit 18c804d07f

View File

@ -591,6 +591,8 @@ begin
else else
// value node. Allow change for simple not null values // value node. Allow change for simple not null values
AllowEdit:=Not (CurrentNodeType in [jtNull,jtArray,jtObject]); AllowEdit:=Not (CurrentNodeType in [jtNull,jtArray,jtObject]);
// compact mode is for viewing only. Editing does not work.
if FOptions.FCompact then AllowEdit:=false;
end; end;
function TMainForm.GetCurrentFind: TTreeNode; function TMainForm.GetCurrentFind: TTreeNode;
@ -1674,6 +1676,8 @@ procedure TJSONTab.JSONFromPreview;
var P : TJSONParser; var P : TJSONParser;
D : TJSONData; D : TJSONData;
begin begin
if FSyn.Modified then
begin
try try
{$IF FPC_FULLVERSION>=30002} {$IF FPC_FULLVERSION>=30002}
P:=TJSONParser.Create(FSyn.Text,[]); P:=TJSONParser.Create(FSyn.Text,[]);
@ -1687,11 +1691,16 @@ begin
finally finally
P.Free; P.Free;
end; end;
end;
end; end;
procedure TJSONTab.ShowJSONDocumentText; procedure TJSONTab.ShowJSONDocumentText;
begin begin
IF Assigned(Root) then FSyn.Text:=Root.FormatJSON(); IF Assigned(Root) then
begin
FSyn.Text:=Root.FormatJSON();
FSyn.Modified:=false;
end;
end; end;
procedure TJSONTab.ShowJSONData(AParent : TTreeNode; Data : TJSONData); procedure TJSONTab.ShowJSONData(AParent : TTreeNode; Data : TJSONData);