refact with type helpers

This commit is contained in:
Basile Burg 2016-01-27 04:43:54 +01:00
parent 7d6e2863cd
commit c407a40259
20 changed files with 73 additions and 71 deletions

View File

@ -96,7 +96,7 @@ begin
fBackup := TStringList.Create; fBackup := TStringList.Create;
// //
fname := getCoeditDocPath + optFname; fname := getCoeditDocPath + optFname;
if fileExists(fname) then if fname.fileExists then
fDmtWrapper.loadFromFile(fname); fDmtWrapper.loadFromFile(fname);
// //
btnCancel.OnClick := @doCancel; btnCancel.OnClick := @doCancel;

View File

@ -169,7 +169,7 @@ var
begin begin
loader := TMemoryStream.Create; loader := TMemoryStream.Create;
try try
fBasePath := extractFilePath(aFilename); fBasePath := aFilename.extractFilePath;
fFilename := aFilename; fFilename := aFilename;
loader.LoadFromFile(fFilename); loader.LoadFromFile(fFilename);
fSaveAsUtf8 := false; fSaveAsUtf8 := false;

View File

@ -228,7 +228,7 @@ begin
if not doc.isDSource then if not doc.isDSource then
continue; continue;
nme := doc.fileName; nme := doc.fileName;
if not FileExists(nme) then if not nme.fileExists then
continue; continue;
{$WARNINGS OFF} {$WARNINGS OFF}
for j := 0 to doc.breakPointsCount-1 do for j := 0 to doc.breakPointsCount-1 do
@ -250,7 +250,7 @@ begin
if fGdb = nil then exit; if fGdb = nil then exit;
if not fGdb.Running then exit; if not fGdb.Running then exit;
nme := sender.fileName; nme := sender.fileName;
if not FileExists(nme) then exit; if not nme.fileExists then exit;
// //
str := cmd[modification] + nme + ':' + intToStr(line); str := cmd[modification] + nme + ':' + intToStr(line);
fGdb.Suspend; fGdb.Suspend;
@ -267,7 +267,7 @@ begin
if fProj = nil then exit; if fProj = nil then exit;
if fProj.binaryKind <> executable then exit; if fProj.binaryKind <> executable then exit;
str := fProj.outputFilename; str := fProj.outputFilename;
if not FileExists(str) then exit; if not str.fileExists then exit;
// gdb process // gdb process
killGdb; killGdb;
fGdb := TCEProcess.create(nil); fGdb := TCEProcess.create(nil);

View File

@ -92,7 +92,7 @@ begin
if trv.Selected.isNotNil then if trv.Selected.isNotNil then
begin begin
result := trv.Selected.Text; result := trv.Selected.Text;
if (not result.fileExists) and assigned(fProj) then if not result.fileExists and assigned(fProj) then
result := fProj.filename.extractFilePath + result; result := fProj.filename.extractFilePath + result;
end; end;
end; end;
@ -104,7 +104,7 @@ var
fname: string; fname: string;
begin begin
fname := getFilename(Source); fname := getFilename(Source);
Accept := fname.fileExists and (not fname.dirExists); Accept := fname.fileExists and not fname.dirExists;
end; end;
procedure TDDHandler.DragDrop(Sender, Source: TObject; X, Y: Integer); procedure TDDHandler.DragDrop(Sender, Source: TObject; X, Y: Integer);

View File

@ -64,13 +64,13 @@ begin
inherited; inherited;
fCol := TCollection.Create(TLibraryItem); fCol := TCollection.Create(TLibraryItem);
fname := getCoeditDocPath + libFname; fname := getCoeditDocPath + libFname;
if fileExists(fname) then if fname.fileExists then
loadFromFile(fname); loadFromFile(fname);
if fCol.Count = 0 then if fCol.Count = 0 then
begin begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
fDmdPath := ExeSearch('dmd.exe'); fDmdPath := ExeSearch('dmd.exe');
if FileExists(fDmdPath) then if fDmdPath.fileExists then
begin begin
// add phobos // add phobos
fname := ExtractFileDir(fDmdPath); fname := ExtractFileDir(fDmdPath);

View File

@ -91,9 +91,9 @@ end;
procedure TCELibManEditorWidget.updateButtonsState; procedure TCELibManEditorWidget.updateButtonsState;
begin begin
btnReg.Enabled := (fProj <> nil) and (fProj.binaryKind = staticlib) and btnReg.Enabled := (fProj <> nil) and (fProj.binaryKind = staticlib) and
FileExists(fProj.Filename); fProj.Filename.fileExists;
btnOpenProj.Enabled := (List.Selected.isNotNil) and btnOpenProj.Enabled := List.Selected.isNotNil and
(fileExists(List.Selected.SubItems[2])); List.Selected.SubItems[2].fileExists;
end; end;
procedure TCELibManEditorWidget.projNew(aProject: ICECommonProject); procedure TCELibManEditorWidget.projNew(aProject: ICECommonProject);
@ -310,7 +310,7 @@ var
begin begin
if List.Selected.isNil then exit; if List.Selected.isNil then exit;
fname := List.Selected.SubItems[2]; fname := List.Selected.SubItems[2];
if not FileExists(fname) then exit; if not fname.fileExists then exit;
// //
if isValidNativeProject(fname) then if isValidNativeProject(fname) then
begin begin
@ -384,7 +384,7 @@ begin
SubItems.add(fname); SubItems.add(fname);
SubItems.add(root); SubItems.add(root);
SubItems.add(fProj.filename); SubItems.add(fProj.filename);
if not FileExists(SubItems[0]) then if not SubItems[0].fileExists then
dlgOkInfo('the library file does not exist, maybe the project not been already compiled ?'); dlgOkInfo('the library file does not exist, maybe the project not been already compiled ?');
Selected:= true; Selected:= true;
end; end;

View File

@ -780,7 +780,7 @@ begin
end; end;
end; end;
value := application.GetOptionValue('p', 'project'); value := application.GetOptionValue('p', 'project');
if value.isNotEmpty and fileExists(value) then if value.isNotEmpty and value.fileExists then
openProj(value); openProj(value);
value := application.GetOptionValue('f', 'files'); value := application.GetOptionValue('f', 'files');
if value.isNotEmpty then if value.isNotEmpty then
@ -790,7 +790,7 @@ begin
lst.DelimitedText := value; lst.DelimitedText := value;
for value in lst do for value in lst do
begin begin
if fileExists(value) then if value.fileExists then
openFile(value); openFile(value);
end; end;
finally finally
@ -949,7 +949,7 @@ var
begin begin
// project and files MRU // project and files MRU
fname := getCoeditDocPath + 'mostrecent.txt'; fname := getCoeditDocPath + 'mostrecent.txt';
if fileExists(fname) then with TCEPersistentMainMrus.create(nil) do if fname.fileExists then with TCEPersistentMainMrus.create(nil) do
try try
setTargets(fFileMru, fProjMru); setTargets(fFileMru, fProjMru);
loadFromFile(fname); loadFromFile(fname);
@ -958,7 +958,7 @@ begin
end; end;
// shortcuts for the actions standing in the main action list // shortcuts for the actions standing in the main action list
fname := getCoeditDocPath + 'mainshortcuts.txt'; fname := getCoeditDocPath + 'mainshortcuts.txt';
if fileExists(fname) then with TCEPersistentMainShortcuts.create(nil) do if fname.fileExists then with TCEPersistentMainShortcuts.create(nil) do
try try
loadFromFile(fname); loadFromFile(fname);
assignTo(self); assignTo(self);
@ -968,7 +968,7 @@ begin
// globals opts // globals opts
fAppliOpts := TCEApplicationOptions.Create(self); fAppliOpts := TCEApplicationOptions.Create(self);
fname := getCoeditDocPath + 'application.txt'; fname := getCoeditDocPath + 'application.txt';
if fileExists(fname) then if fname.fileExists then
begin begin
fAppliOpts.loadFromFile(fname); fAppliOpts.loadFromFile(fname);
fAppliOpts.assignTo(self); fAppliOpts.assignTo(self);
@ -1524,7 +1524,7 @@ procedure TCEMainForm.saveFile(aDocument: TCESynMemo);
begin begin
if (aDocument.Highlighter = LfmSyn) or (aDocument.Highlighter = JsSyn) then if (aDocument.Highlighter = LfmSyn) or (aDocument.Highlighter = JsSyn) then
saveProjSource(aDocument) saveProjSource(aDocument)
else if fileExists(aDocument.fileName) then else if aDocument.fileName.fileExists then
aDocument.save; aDocument.save;
end; end;
@ -1548,7 +1548,7 @@ end;
procedure TCEMainForm.actProjOpenContFoldExecute(Sender: TObject); procedure TCEMainForm.actProjOpenContFoldExecute(Sender: TObject);
begin begin
if fProjectInterface = nil then exit; if fProjectInterface = nil then exit;
if not fileExists(fProjectInterface.filename) then exit; if not fProjectInterface.filename.fileExists then exit;
// //
DockMaster.GetAnchorSite(fExplWidg).Show; DockMaster.GetAnchorSite(fExplWidg).Show;
fExplWidg.expandPath(fProjectInterface.filename.extractFilePath); fExplWidg.expandPath(fProjectInterface.filename.extractFilePath);
@ -1598,7 +1598,7 @@ begin
if fDoc.isNil then exit; if fDoc.isNil then exit;
// //
str := fDoc.fileName; str := fDoc.fileName;
if (str <> fDoc.tempFilename) and (fileExists(str)) then if (str <> fDoc.tempFilename) and str.fileExists then
saveFile(fDoc) saveFile(fDoc)
else else
actFileSaveAs.Execute; actFileSaveAs.Execute;
@ -1612,7 +1612,7 @@ begin
// //
if fProjectInterface.getFormat = pfNative then if fProjectInterface.getFormat = pfNative then
begin begin
if fileExists(fDoc.fileName) and (not fDoc.isTemporary) then if fDoc.fileName.fileExists and not fDoc.isTemporary then
fNativeProject.addSource(fDoc.fileName) fNativeProject.addSource(fDoc.fileName)
else dlgOkInfo('the file has not been added to the project because it does not exist'); else dlgOkInfo('the file has not been added to the project because it does not exist');
end else end else
@ -1889,7 +1889,7 @@ begin
fMsgs.message('compiling ' + shortenPath(fDoc.fileName, 25), fDoc, amcEdit, amkInf); fMsgs.message('compiling ' + shortenPath(fDoc.fileName, 25), fDoc, amcEdit, amkInf);
if fileExists(fDoc.fileName) then fDoc.save if fDoc.fileName.fileExists then fDoc.save
else fDoc.saveTempFile; else fDoc.saveTempFile;
fname := stripFileExt(fDoc.fileName); fname := stripFileExt(fDoc.fileName);
@ -1978,7 +1978,7 @@ end;
procedure TCEMainForm.actFileOpenContFoldExecute(Sender: TObject); procedure TCEMainForm.actFileOpenContFoldExecute(Sender: TObject);
begin begin
if fDoc.isNil then exit; if fDoc.isNil then exit;
if not fileExists(fDoc.fileName) then exit; if not fDoc.fileName.fileExists then exit;
// //
DockMaster.GetAnchorSite(fExplWidg).Show; DockMaster.GetAnchorSite(fExplWidg).Show;
fExplWidg.expandPath(fDoc.fileName.extractFilePath); fExplWidg.expandPath(fDoc.fileName.extractFilePath);
@ -2015,7 +2015,7 @@ begin
if (not fProjectInterface.targetUpToDate) then if if (not fProjectInterface.targetUpToDate) then if
dlgOkCancel('The project output is not up-to-date, rebuild ?') = mrOK then dlgOkCancel('The project output is not up-to-date, rebuild ?') = mrOK then
fProjectInterface.compile; fProjectInterface.compile;
if fileExists(fProjectInterface.outputFilename) if fProjectInterface.outputFilename.fileExists
or (fProjectInterface.getFormat = pfDub) then or (fProjectInterface.getFormat = pfDub) then
fProjectInterface.run; fProjectInterface.run;
end; end;
@ -2065,7 +2065,7 @@ procedure TCEMainForm.layoutLoadFromFile(const aFilename: string);
var var
xcfg: TXMLConfigStorage; xcfg: TXMLConfigStorage;
begin begin
if not fileExists(aFilename) then if not aFilename.fileExists then
exit; exit;
// //
xcfg := TXMLConfigStorage.Create(aFilename, true); xcfg := TXMLConfigStorage.Create(aFilename, true);
@ -2186,7 +2186,7 @@ end;
{$REGION project ---------------------------------------------------------------} {$REGION project ---------------------------------------------------------------}
procedure TCEMainForm.showProjTitle; procedure TCEMainForm.showProjTitle;
begin begin
if (fProjectInterface <> nil) and fileExists(fProjectInterface.filename) then if (fProjectInterface <> nil) and fProjectInterface.filename.fileExists then
caption := format('Coedit - %s', [shortenPath(fProjectInterface.filename, 30)]) caption := format('Coedit - %s', [shortenPath(fProjectInterface.filename, 30)])
else else
caption := 'Coedit'; caption := 'Coedit';
@ -2331,7 +2331,7 @@ end;
procedure TCEMainForm.actProjSourceExecute(Sender: TObject); procedure TCEMainForm.actProjSourceExecute(Sender: TObject);
begin begin
if fProjectInterface = nil then exit; if fProjectInterface = nil then exit;
if not fileExists(fProjectInterface.filename) then exit; if not fProjectInterface.filename.fileExists then exit;
// //
openFile(fProjectInterface.filename); openFile(fProjectInterface.filename);
if fProjectInterface.getFormat = pfNative then if fProjectInterface.getFormat = pfNative then

View File

@ -312,7 +312,7 @@ begin
AssignPng(btnClearCat, 'clean'); AssignPng(btnClearCat, 'clean');
// //
fname := getCoeditDocPath + optname; fname := getCoeditDocPath + optname;
if fileExists(fname) then if fname.fileExists then
begin begin
fOptions.loadFromFile(fname); fOptions.loadFromFile(fname);
fOptions.AssignTo(self); fOptions.AssignTo(self);
@ -1031,27 +1031,27 @@ begin
and (aMessage[i..i+5] = '-mixin'))) then and (aMessage[i..i+5] = '-mixin'))) then
begin begin
// absolute fname // absolute fname
if fileExists(ident) then if ident.fileExists then
begin begin
getMultiDocHandler.openDocument(ident); getMultiDocHandler.openDocument(ident);
exit(true); exit(true);
end; end;
// relative fname if project file is the base path to a rel. fname // relative fname if project file is the base path to a rel. fname
absName := ExpandFileName(ident); absName := ExpandFileName(ident);
if fileExists(absName) then if absName.fileExists then
begin begin
getMultiDocHandler.openDocument(absName); getMultiDocHandler.openDocument(absName);
exit(true); exit(true);
end; end;
// if fname relative to native project path or project filed 'root' // if fname relative to native project path or project filed 'root'
absName := expandFilenameEx(symbolExpander.get('<CPP>') + DirectorySeparator, ident); absName := expandFilenameEx(symbolExpander.get('<CPP>') + DirectorySeparator, ident);
if fileExists(absName) then if absName.fileExists then
begin begin
getMultiDocHandler.openDocument(absName); getMultiDocHandler.openDocument(absName);
exit(true); exit(true);
end; end;
absName := expandFilenameEx(symbolExpander.get('<CPR>') + DirectorySeparator, ident); absName := expandFilenameEx(symbolExpander.get('<CPR>') + DirectorySeparator, ident);
if fileExists(absName) then if absName.fileExists then
begin begin
getMultiDocHandler.openDocument(absName); getMultiDocHandler.openDocument(absName);
exit(true); exit(true);

View File

@ -268,7 +268,7 @@ begin
treeSetRoots; treeSetRoots;
// //
fname := getCoeditDocPath + OptsFname; fname := getCoeditDocPath + OptsFname;
if fileExists(fname) then with TCEMiniExplorerOptions.create(nil) do if fname.fileExists then with TCEMiniExplorerOptions.create(nil) do
try try
loadFromFile(fname); loadFromFile(fname);
assignTo(self); assignTo(self);
@ -459,7 +459,7 @@ begin
if lstFiles.Selected.isNil then exit; if lstFiles.Selected.isNil then exit;
if lstFiles.Selected.Data.isNil then exit; if lstFiles.Selected.Data.isNil then exit;
fname := PString(lstFiles.Selected.Data)^; fname := PString(lstFiles.Selected.Data)^;
if not fileExists(fname) then exit; if not fname.fileExists then exit;
{$IFNDEF WINDOWS} {$IFNDEF WINDOWS}
fname := fname[2..length(fname)]; fname := fname[2..length(fname)];
{$ENDIF} {$ENDIF}
@ -531,7 +531,7 @@ begin
if lstFav.Selected.Data.isNil then exit; if lstFav.Selected.Data.isNil then exit;
fname := PString(lstFav.Selected.Data)^; fname := PString(lstFav.Selected.Data)^;
end; end;
if fileExists(fname) then if not shellOpen(fname) then if fname.fileExists then if not shellOpen(fname) then
getMessageDisplay.message((format('the shell failed to open "%s"', getMessageDisplay.message((format('the shell failed to open "%s"',
[shortenPath(fname, 25)])), nil, amcMisc, amkErr); [shortenPath(fname, 25)])), nil, amcMisc, amkErr);
end; end;

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, ce_interfaces, ce_observer, Classes, SysUtils, ce_interfaces, ce_observer,
ce_nativeproject, ce_synmemo; ce_nativeproject, ce_synmemo, ce_common;
type type
@ -141,13 +141,13 @@ var
begin begin
inherited; inherited;
for i := Count-1 downto 0 do for i := Count-1 downto 0 do
if not fileExists(Strings[i]) then if not Strings[i].fileExists then
Delete(i); Delete(i);
end; end;
function TCEMRUFileList.checkItem(const S: string): boolean; function TCEMRUFileList.checkItem(const S: string): boolean;
begin begin
exit( inherited checkItem(S) and fileExists(S)); exit( inherited checkItem(S) and S.fileExists);
end; end;
constructor TCEMRUDocumentList.create; constructor TCEMRUDocumentList.create;
@ -176,7 +176,7 @@ end;
procedure TCEMRUDocumentList.docClosing(aDoc: TCESynMemo); procedure TCEMRUDocumentList.docClosing(aDoc: TCESynMemo);
begin begin
if FileExists(aDoc.fileName) and (aDoc.fileName <> aDoc.tempFilename) then if aDoc.fileName.fileExists and not aDoc.isTemporary then
Insert(0, aDoc.fileName); Insert(0, aDoc.fileName);
end; end;
@ -215,7 +215,8 @@ begin
if aProject = nil then exit; if aProject = nil then exit;
// //
fname := aProject.filename; fname := aProject.filename;
if FileExists(fname) then Insert(0, fname); if fname.fileExists then
Insert(0, fname);
end; end;
initialization initialization

View File

@ -54,7 +54,7 @@ begin
fMru.maxCount := 25; fMru.maxCount := 25;
EntitiesConnector.addSingleService(self); EntitiesConnector.addSingleService(self);
fname := getCoeditDocPath + OptsFname; fname := getCoeditDocPath + OptsFname;
if fileExists(OptsFname) then if OptsFname.fileExists then
fMru.LoadFromFile(fname); fMru.LoadFromFile(fname);
if fMru.Count = 0 then if fMru.Count = 0 then
fMru.Insert(0, '(your input here)'); fMru.Insert(0, '(your input here)');

View File

@ -357,7 +357,7 @@ begin
lst := TStringList.Create; lst := TStringList.Create;
fProject.beginUpdate; fProject.beginUpdate;
try for fname in Filenames do try for fname in Filenames do
if FileExists(fname) then if fname.fileExists then
addFile(fname) addFile(fname)
else if fname.dirExists then else if fname.dirExists then
begin begin

View File

@ -216,7 +216,7 @@ begin
fReplaceMru:= TCEMruList.Create; fReplaceMru:= TCEMruList.Create;
// //
fname := getCoeditDocPath + OptsFname; fname := getCoeditDocPath + OptsFname;
if FileExists(fname) then with TCESearchOptions.create(nil) do if fname.fileExists then with TCESearchOptions.create(nil) do
try try
loadFromFile(fname); loadFromFile(fname);
AssignTo(self); AssignTo(self);

View File

@ -208,7 +208,7 @@ begin
fOptions := TStaticMacrosOptions.create(self); fOptions := TStaticMacrosOptions.create(self);
fOptionBackup := TStaticMacrosOptions.create(self); fOptionBackup := TStaticMacrosOptions.create(self);
fname := getCoeditDocPath + OptFname; fname := getCoeditDocPath + OptFname;
if fileExists(fname) then if fname.fileExists then
begin begin
fOptions.loadFromFile(fname); fOptions.loadFromFile(fname);
// old option file will create a streaming error. // old option file will create a streaming error.

View File

@ -353,7 +353,7 @@ begin
fOptions := TCESymbolListOptions.Create(self); fOptions := TCESymbolListOptions.Create(self);
fOptions.Name:= 'symbolListOptions'; fOptions.Name:= 'symbolListOptions';
fname := getCoeditDocPath + OptsFname; fname := getCoeditDocPath + OptsFname;
if FileExists(fname) then if fname.fileExists then
fOptions.loadFromFile(fname); fOptions.loadFromFile(fname);
fOptions.AssignTo(self); fOptions.AssignTo(self);
// //
@ -650,7 +650,7 @@ end;
procedure TCESymbolListWidget.checkIfHasToolExe; procedure TCESymbolListWidget.checkIfHasToolExe;
begin begin
fToolExeName := exeFullName(toolExeName); fToolExeName := exeFullName(toolExeName);
fHasToolExe := FileExists(fToolExeName); fHasToolExe := fToolExeName.fileExists;
end; end;
procedure TCESymbolListWidget.callToolProc; procedure TCESymbolListWidget.callToolProc;

View File

@ -171,7 +171,7 @@ begin
// document // document
if hasDoc then if hasDoc then
begin begin
if not fileExists(fDoc.fileName) then if not fDoc.fileName.fileExists then
fDoc.saveTempFile; fDoc.saveTempFile;
fSymbols[CFF] := fDoc.fileName; fSymbols[CFF] := fDoc.fileName;
fSymbols[CFP] := fDoc.fileName.extractFilePath; fSymbols[CFP] := fDoc.fileName.extractFilePath;
@ -209,7 +209,7 @@ begin
end; end;
if hasNativeProj then if hasNativeProj then
begin begin
if fileExists(fProj.fileName) then if fProj.fileName.fileExists then
begin begin
fSymbols[CPR] := expandFilenameEx(fProj.basePath, fProj.RootFolder); fSymbols[CPR] := expandFilenameEx(fProj.basePath, fProj.RootFolder);
if fSymbols[CPR].isEmpty then if fSymbols[CPR].isEmpty then

View File

@ -362,7 +362,7 @@ var
begin begin
tempn := fMemo.fileName; tempn := fMemo.fileName;
if tempn = fMemo.tempFilename then exit; if tempn = fMemo.tempFilename then exit;
if not fileExists(tempn) then exit; if not tempn.fileExists then exit;
// //
fname := getCoeditDocPath + 'editorcache' + DirectorySeparator; fname := getCoeditDocPath + 'editorcache' + DirectorySeparator;
ForceDirectories(fname); ForceDirectories(fname);
@ -379,14 +379,14 @@ var
chksm: Cardinal; chksm: Cardinal;
begin begin
tempn := fMemo.fileName; tempn := fMemo.fileName;
if not fileExists(tempn) then exit; if not tempn.fileExists then exit;
// //
fname := getCoeditDocPath + 'editorcache' + DirectorySeparator; fname := getCoeditDocPath + 'editorcache' + DirectorySeparator;
chksm := crc32(0, nil, 0); chksm := crc32(0, nil, 0);
chksm := crc32(chksm, @tempn[1], length(tempn)); chksm := crc32(chksm, @tempn[1], length(tempn));
fname := fname + format('%.8X.txt', [chksm]); fname := fname + format('%.8X.txt', [chksm]);
// //
if not fileExists(fname) then exit; if not fname.fileExists then exit;
loadFromFile(fname); loadFromFile(fname);
end; end;
{$IFDEF DEBUG}{$R+}{$ENDIF} {$IFDEF DEBUG}{$R+}{$ENDIF}
@ -548,7 +548,7 @@ begin
fBreakPoints.Free; fBreakPoints.Free;
fCallTipStrings.Free; fCallTipStrings.Free;
// //
if fileExists(fTempFileName) then if fTempFileName.fileExists then
sysutils.DeleteFile(fTempFileName); sysutils.DeleteFile(fTempFileName);
// //
inherited; inherited;

View File

@ -225,7 +225,7 @@ begin
AssignPng(btnGo, 'arrow_pen'); AssignPng(btnGo, 'arrow_pen');
// //
fname := getCoeditDocPath + OptFname; fname := getCoeditDocPath + OptFname;
if FileExists(fname) then if fname.fileExists then
fOptions.loadFromFile(fname); fOptions.loadFromFile(fname);
fOptions.AssignTo(self); fOptions.AssignTo(self);
// //

View File

@ -267,7 +267,7 @@ begin
inherited; inherited;
fTools := TCEToolItems.Create(TCEToolItem); fTools := TCEToolItems.Create(TCEToolItem);
fname := getCoeditDocPath + toolsFname; fname := getCoeditDocPath + toolsFname;
if fileExists(fname) then loadFromFile(fname); if fname.fileExists then loadFromFile(fname);
// //
EntitiesConnector.addObserver(self); EntitiesConnector.addObserver(self);
end; end;

View File

@ -212,7 +212,7 @@ General questions and discussions (Q, BLA) about the use are also allowed since
- **"Save project as"**: saves the current project from a dialog. - **"Save project as"**: saves the current project from a dialog.
- **"Project configuration"**: displays the project configuration widget. - **"Project configuration"**: displays the project configuration widget.
- **"Edit project file"**: opens the project file in a new editor. When saved from a source editor, a project file is directly reloaded. It means that a particular care must be taken during the edition. Coedit will skip any error in the project file, without warnings. - **"Edit project file"**: opens the project file in a new editor. When saved from a source editor, a project file is directly reloaded. It means that a particular care must be taken during the edition. Coedit will skip any error in the project file, without warnings.
- **"View project command line"**: displays the list of the switches and their arguments, as passed to DMD before the compilation. Note that under Windows, the content can be copied using the <kbd>Ctrl</kbd>+<kbd>C</kbd> shortcut on the dialog. - **"View project command line"**: displays the list of the switches and their arguments, as passed to DMD before the compilation. Note that under Windows, the content can be copied using the <kbd>Ctrl</kbd> + <kbd>C</kbd> shortcut on the dialog.
- **"View in mini explorer"**: expands the [mini-explorer][lnk_widg_miniexpl] tree on the folder containing the project file. - **"View in mini explorer"**: expands the [mini-explorer][lnk_widg_miniexpl] tree on the folder containing the project file.
- **"Compile project"**: compiles the project using the current configuration. - **"Compile project"**: compiles the project using the current configuration.
- **"Compile and run project"**: compiles the project using the current configuration and execute the output if the option _binaryKind_ is set to _executable_. - **"Compile and run project"**: compiles the project using the current configuration and execute the output if the option _binaryKind_ is set to _executable_.
@ -422,10 +422,10 @@ The _source editor widget_ is a standard code editor, specialized for highlighti
- folding: curly brackets blocks, multi-line strings, block comments, nested block comments, DDoc comments blocks. - folding: curly brackets blocks, multi-line strings, block comments, nested block comments, DDoc comments blocks.
- colorization of the following categories: keywords, special keywords, numbers, symbols, comments, assembler instructions and identifiers, DDoc comments. - colorization of the following categories: keywords, special keywords, numbers, symbols, comments, assembler instructions and identifiers, DDoc comments.
- current identifier markup, selection markup. - current identifier markup, selection markup.
- standard keyboard navigation shortcuts <kbd>CTRL</kbd> + (<kbd>SHIFT</kbd> +) <kbd>LEFT</kbd>/<kbd>RIGHT</kbd>, <kbd>CTRL</kbd> + <kbd>HOME</kbd>, <kbd>CTRL</kbd> + <kbd>END</kbd> etc. - standard keyboard navigation shortcuts <kbd>CTRL</kbd> + [<kbd>SHIFT</kbd> +] <kbd>LEFT</kbd> | <kbd>RIGHT</kbd>, <kbd>CTRL</kbd> + <kbd>HOME</kbd>, <kbd>CTRL</kbd> + <kbd>END</kbd> etc.
- macro recording and playback using <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>R</kbd> (start/stop recording) or <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>P</kbd> (play). - macro recording and playback using <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>R</kbd> (start or stop recording) or <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>P</kbd> (play).
- synchro-edit (activated when clicking the pen icon located in the gutter, or with the shortcut <kbd>CTRL</kbd>+<kbd>E</kbd> and <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>E</kbd>). - synchro-edit (activated when clicking the pen icon located in the gutter, or with the shortcut <kbd>CTRL</kbd> + <kbd>E</kbd> and <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>E</kbd>).
- zoom: (<kbd>CTRL</kbd>+<kbd>WHEEL</kbd>, <kbd>CTRL</kbd>+<kbd>MIDDLE MB</kbd>, <kbd>CTRL</kbd>+<kbd>+</kbd>, <kbd>CTRL</kbd>+<kbd>-</kbd>, <kbd>CTRL</kbd>+<kbd>.</kbd>). - zoom: <kbd>CTRL</kbd> + <kbd>WHEEL</kbd>, <kbd>CTRL</kbd> + <kbd>MIDDLE MB</kbd>, <kbd>CTRL</kbd> + <kbd>+</kbd> | <kbd>-</kbd> | <kbd>.</kbd>.
- display cache: for each document, the zoom ratio, the folding state and the caret position are saved between two sessions. A cache file has a fixed life-time of three months from its last modification. - display cache: for each document, the zoom ratio, the folding state and the caret position are saved between two sessions. A cache file has a fixed life-time of three months from its last modification.
- drag & drop editing. - drag & drop editing.
- external modification tracking. Each time the focus is put on a document (switch document, show & hide application), Coedit verifies if its time stamp has changed. - external modification tracking. Each time the focus is put on a document (switch document, show & hide application), Coedit verifies if its time stamp has changed.
@ -507,22 +507,23 @@ The _find and replace_ widget allows to find and replace text patterns in the fo
![](https://raw.githubusercontent.com/BBasile/CoeditWikiData/master/search1.png) ![](https://raw.githubusercontent.com/BBasile/CoeditWikiData/master/search1.png)
- top field: the pattern to find. - first field: the pattern to find.
- second field: the expression used as replacement. Only active when **"replace with"** is checked. - second field: the pattern used as replacement, only active when **"replace with"** is checked.
- whole word: only search for the whole expression. - whole word: only search for the whole pattern.
- backward: search from the bottom to the top. - backward: search from the current position to the top.
- from cursor: when unchecked, the operation always starts from the top of the document. - from cursor: when unchecked, the operation always starts from the top of the document.
- case sensitive: when unchecked, character case is ignored. - case sensitive: when unchecked, the case is ignored.
- prompt: a confirmation is required to replace an expression. - prompt: a confirmation is required to replace a match.
- allow regex: when checked, the search is performed by a regex engine. - allow regex: when checked, the search is performed by a regex engine.
By default <kbd>CTRL</kbd> + <kbd>F</kbd> is used to pass the current source code editor selection to the top field By default <kbd>CTRL</kbd> + <kbd>F</kbd> is used to pass the current identifier to the first field and <kbd>F3</kbd> to execute a search.
and <kbd>F3</kbd> to execute a search. Unless _Find all_ is used, the results are directly visible in the editor. Unless _Find all_ is used, the results are directly visible in the editor.
_Find all_ results are displayed in the [messages widget][lnk_widg_msg] and are clickable. _Find all_ results are displayed in the [messages widget][lnk_widg_msg] and are clickable.
The scope of _Find all_ can be set, either to the current editor or to the whole project, by clicking the icon at the right.
The most recent searches and replacements are saved between each session. The most recent searches and replacements are saved between each session.
Note that to find a symbol, <kbd>Ctrl</kbd>+<kbd>MB Left</kbd> or the [symbol list][lnk_widg_symlist] are faster. Note that to find a symbol, <kbd>Ctrl</kbd> + <kbd>MB Left</kbd> or the [symbol list][lnk_widg_symlist] are faster.
## Library manager widget ## Library manager widget
@ -1180,7 +1181,7 @@ as well as the additional source (the _libdparse.lib_).
### Completion and runnable ### Completion and runnable
In the **File** menu click **New runnable module**. In the **File** menu click **New runnable module**.
type import **std.d** and hit <kbd>CTRL</kbd>+<kbd>SCPACE</kbd> to invoke the completion. type import **std.d** and hit <kbd>CTRL</kbd> + <kbd>SCPACE</kbd> to invoke the completion.
[DCD][lnk_dcd], automatically aware of _libdparse_, will propose the item **lexer**, [DCD][lnk_dcd], automatically aware of _libdparse_, will propose the item **lexer**,
which matches to one of the module of the library (the D language lexer). which matches to one of the module of the library (the D language lexer).