1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-21 08:45:06 -05:00

Simba: External editor now works.

This commit is contained in:
Merlijn Wajer 2011-02-23 13:09:05 +01:00
parent 4c1d67d1b6
commit ff7228ba70
2 changed files with 15 additions and 4 deletions

View File

@ -597,6 +597,7 @@ begin
Command := ACmd;
end;
end;
constructor TScriptFrame.Create(TheOwner: TComponent);
const
AdditionalFolds:TPascalCodeFoldBlockTypes = [cfbtSlashComment,cfbtBorCommand,cfbtAnsiComment];
@ -618,6 +619,9 @@ begin
FScriptState:= ss_None;
ScriptErrorLine:= -1;
OwnerSheet.Caption:= ScriptName;
SynEdit.Enabled := True; // For some reason we need this?
SynEdit.Highlighter := SimbaForm.CurrHighlighter;
SynEdit.Options := SynEdit.Options + [eoTabIndent, eoKeepCaretX, eoDragDropEditing] - [eoSmartTabs];
SynEdit.Options2 := SynEdit.Options2 + [eoCaretSkipsSelection];
@ -668,15 +672,23 @@ var
begin
try
ExternScript := TFileStream.Create(ScriptFile, fmOpenRead);
ExternScript.Read(NewScript, ExternScript.Size);
SynEdit.Lines.SetText(PChar(NewScript));
except
on EFOpenError do
begin
formWriteln('Could not open extern script :' + ScriptFile);
exit;
end;
end;
try
SetLength(NewScript, ExternScript.Size);
ExternScript.Read(NewScript[1], ExternScript.Size);
SynEdit.Lines.SetText(PChar(NewScript));
SetLength(NewScript, 0);
finally
ExternScript.Free;
end;
end;
initialization

View File

@ -2584,7 +2584,6 @@ begin
CloseTabs(PopupTab);
end;
procedure TSimbaForm.MenuItemReadOnlyTabClick(Sender: TObject);
var
Tab: TMufasaTab;