* 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;
@ -1673,6 +1675,8 @@ end;
procedure TJSONTab.JSONFromPreview; procedure TJSONTab.JSONFromPreview;
var P : TJSONParser; var P : TJSONParser;
D : TJSONData; D : TJSONData;
begin
if FSyn.Modified then
begin begin
try try
{$IF FPC_FULLVERSION>=30002} {$IF FPC_FULLVERSION>=30002}
@ -1688,10 +1692,15 @@ begin
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);