style, remove all occurences of `then\ [a-z,A-Z]`

This commit is contained in:
Basile Burg 2019-02-05 19:08:09 +01:00
parent 474a07dca4
commit e6e0dc6215
32 changed files with 660 additions and 402 deletions

View File

@ -237,9 +237,12 @@ begin
expand := fBasePath.dirExists; expand := fBasePath.dirExists;
for relSrc in fSrcs do for relSrc in fSrcs do
begin begin
if not expand then absSrc := relSrc if not expand then
else absSrc := expandFilenameEx(fBasePath, relsrc); absSrc := relSrc
if SameFileName(fname, absSrc) then exit; else
absSrc := expandFilenameEx(fBasePath, relsrc);
if SameFileName(fname, absSrc) then
exit;
end; end;
relSrc := ExtractRelativePath(fBasePath, fname); relSrc := ExtractRelativePath(fBasePath, fname);
fSrcs.Add(relSrc); fSrcs.Add(relSrc);
@ -247,7 +250,8 @@ end;
procedure TNativeProject.setRoot(const value: string); procedure TNativeProject.setRoot(const value: string);
begin begin
if fRootFolder = value then exit; if fRootFolder = value then
exit;
beginUpdate; beginUpdate;
fRootFolder := value; fRootFolder := value;
endUpdate; endUpdate;
@ -457,7 +461,8 @@ var
rel: string; rel: string;
lst: TStringList; lst: TStringList;
begin begin
if fConfIx = -1 then exit; if fConfIx = -1 then
exit;
exc := TStringList.Create; exc := TStringList.Create;
try try
cfg := currentConfiguration; cfg := currentConfiguration;
@ -471,7 +476,8 @@ begin
for rel in fSrcs do if rel <> '' then for rel in fSrcs do if rel <> '' then
opts.Add(expandFilenameEx(fBasePath, rel)); // note: process.inc ln 249. double quotes are added if there's a space. opts.Add(expandFilenameEx(fBasePath, rel)); // note: process.inc ln 249. double quotes are added if there's a space.
// exclusions // exclusions
if exc.Count > 0 then with TRegExpr.Create do if exc.Count > 0 then
with TRegExpr.Create do
try try
for str in exc do for str in exc do
begin begin
@ -574,15 +580,18 @@ var
src: string; src: string;
i: Integer; i: Integer;
begin begin
if fSrcs.Count = 0 then exit; if fSrcs.Count = 0 then
exit;
allMissing := true; allMissing := true;
for i:= 0 to fSrcs.Count-1 do for i:= 0 to fSrcs.Count-1 do
if sourceAbsolute(i).fileExists then if sourceAbsolute(i).fileExists then
allMissing := false; allMissing := false;
if not allMissing then exit; if not allMissing then
exit;
if dlgYesNo( 'The project source(s) are all missing. ' + LineEnding + if dlgYesNo( 'The project source(s) are all missing. ' + LineEnding +
'This can be encountered if the project file has been moved from its original location.' + LineEnding + LineEnding + 'This can be encountered if the project file has been moved from its original location.' + LineEnding + LineEnding +
'Do you wish to select the new root folder ?') <> mrYes then exit; 'Do you wish to select the new root folder ?') <> mrYes then
exit;
// TODO-cimprovement: use commonFolder() when it'll be compat. with the rel. paths. // TODO-cimprovement: use commonFolder() when it'll be compat. with the rel. paths.
// hint for the common dir // hint for the common dir
dirHint := fSrcs[i]; dirHint := fSrcs[i];
@ -611,12 +620,14 @@ var
for i:= fSrcs.Count-1 downto 0 do for i:= fSrcs.Count-1 downto 0 do
begin begin
oldsrc := sourceAbsolute(i); oldsrc := sourceAbsolute(i);
if oldsrc.fileExists then continue; if oldsrc.fileExists then
continue;
if dlgYesNo(format('a particular project source file ("%s") is missing. ' if dlgYesNo(format('a particular project source file ("%s") is missing. '
+ LineEnding + 'This happends if a source file has been moved, renamed ' + + LineEnding + 'This happends if a source file has been moved, renamed ' +
'or deleted.' + LineEnding + LineEnding + 'or deleted.' + LineEnding + LineEnding +
'Do you wish to select its new location?', [fSrcs[i]])) <> mrYes then exit; 'Do you wish to select its new location?', [fSrcs[i]])) <> mrYes then
// exit;
opendlg := TOpenDialog.Create(nil); opendlg := TOpenDialog.Create(nil);
try try
opendlg.InitialDir := fFilename.extractFilePath; opendlg.InitialDir := fFilename.extractFilePath;
@ -723,11 +734,15 @@ begin
ext := fOutputFilename.extractFileExt; ext := fOutputFilename.extractFileExt;
case currentConfiguration.outputOptions.binaryKind of case currentConfiguration.outputOptions.binaryKind of
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
executable: if ext <> exeExt then fOutputFilename += exeExt; executable: if ext <> exeExt then
fOutputFilename += exeExt;
{$ENDIF} {$ENDIF}
staticlib: if ext <> libExt then fOutputFilename += libExt; staticlib: if ext <> libExt then
sharedlib: if ext <> dynExt then fOutputFilename += dynExt; fOutputFilename += libExt;
obj: if ext <> dynExt then fOutputFilename += objExt; sharedlib: if ext <> dynExt then
fOutputFilename += dynExt;
obj: if ext <> dynExt then
fOutputFilename += objExt;
end; end;
end; end;
// //
@ -984,10 +999,12 @@ var
i: integer; i: integer;
begin begin
result := false; result := false;
if not fOutputFilename.fileExists then exit; if not fOutputFilename.fileExists then
exit;
dt := FileAge(fOutputFilename); dt := FileAge(fOutputFilename);
for i := 0 to fSrcs.Count-1 do for i := 0 to fSrcs.Count-1 do
if fileAge(sourceAbsolute(i)) > dt then exit; if fileAge(sourceAbsolute(i)) > dt then
exit;
result := true; result := true;
end; end;
@ -1013,8 +1030,10 @@ end;
function TNativeProject.configurationName(index: integer): string; function TNativeProject.configurationName(index: integer): string;
begin begin
if index > fConfigs.Count -1 then index := fConfigs.Count -1; if index > fConfigs.Count -1 then
if index < 0 then index := 0; index := fConfigs.Count -1;
if index < 0 then
index := 0;
result := getConfig(index).name; result := getConfig(index).name;
end; end;

View File

@ -89,7 +89,8 @@ end;
procedure TProjectConfigurationWidget.SetVisible(value: boolean); procedure TProjectConfigurationWidget.SetVisible(value: boolean);
begin begin
inherited; inherited;
if Visible then updateImperative; if Visible then
updateImperative;
end; end;
{$ENDREGION --------------------------------------------------------------------} {$ENDREGION --------------------------------------------------------------------}
@ -101,16 +102,16 @@ begin
if project.getFormat <> pfDEXED then if project.getFormat <> pfDEXED then
exit; exit;
enabled := true; enabled := true;
//
fProj := TNativeProject(project.getProject); fProj := TNativeProject(project.getProject);
if Visible then updateImperative; if Visible then
updateImperative;
syncroMode := false; syncroMode := false;
end; end;
procedure TProjectConfigurationWidget.projClosing(project: ICommonProject); procedure TProjectConfigurationWidget.projClosing(project: ICommonProject);
begin begin
if fProj.isNil then exit; if fProj.isNil or (fProj <> project.getProject) then
if fProj <> project.getProject then
exit; exit;
inspector.TIObject := nil; inspector.TIObject := nil;
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
@ -122,10 +123,10 @@ end;
procedure TProjectConfigurationWidget.projChanged(project: ICommonProject); procedure TProjectConfigurationWidget.projChanged(project: ICommonProject);
begin begin
if fProj.isNil then exit; if fProj.isNil or (fProj <> project.getProject) then
if fProj <> project.getProject then
exit; exit;
if Visible then updateImperative; if Visible then
updateImperative;
end; end;
procedure TProjectConfigurationWidget.projFocused(project: ICommonProject); procedure TProjectConfigurationWidget.projFocused(project: ICommonProject);
@ -135,9 +136,9 @@ begin
if project.getFormat <> pfDEXED then if project.getFormat <> pfDEXED then
exit; exit;
enabled := true; enabled := true;
//
fProj := TNativeProject(project.getProject); fProj := TNativeProject(project.getProject);
if Visible then updateImperative; if Visible then
updateImperative;
end; end;
procedure TProjectConfigurationWidget.projCompiling(project: ICommonProject); procedure TProjectConfigurationWidget.projCompiling(project: ICommonProject);
@ -152,10 +153,13 @@ end;
{$REGION config. things --------------------------------------------------------} {$REGION config. things --------------------------------------------------------}
procedure TProjectConfigurationWidget.selConfChange(Sender: TObject); procedure TProjectConfigurationWidget.selConfChange(Sender: TObject);
begin begin
if fProj.isNil then exit; if fProj.isNil then
if Updating then exit; exit;
if selConf.ItemIndex = -1 then exit; if Updating then
// exit;
if selConf.ItemIndex = -1 then
exit;
beginImperativeUpdate; beginImperativeUpdate;
fProj.ConfigurationIndex := selConf.ItemIndex; fProj.ConfigurationIndex := selConf.ItemIndex;
endImperativeUpdate; endImperativeUpdate;
@ -184,7 +188,8 @@ var
i: Integer; i: Integer;
begin begin
i := fSynchroItem.IndexOf(Item); i := fSynchroItem.IndexOf(Item);
if i = -1 then exit(''); if i = -1 then
exit('');
result := fSynchroValue[i]; result := fSynchroValue[i];
end; end;
@ -203,11 +208,15 @@ var
trg_obj: TPersistent; trg_obj: TPersistent;
i: Integer; i: Integer;
begin begin
if fProj.isNil then exit; if fProj.isNil then
if not fSyncroMode then exit; exit;
if inspector.TIObject.isNil then exit; if not fSyncroMode then
if inspector.ItemIndex = -1 then exit; exit;
// if inspector.TIObject.isNil then
exit;
if inspector.ItemIndex = -1 then
exit;
storage := nil; storage := nil;
src_prop:= nil; src_prop:= nil;
trg_prop:= nil; trg_prop:= nil;
@ -220,13 +229,15 @@ begin
fProj.beginUpdate; fProj.beginUpdate;
try try
src_prop := src_list.Find(propstr); src_prop := src_list.Find(propstr);
if src_prop = nil then exit; if src_prop = nil then
exit;
storage.AObject := getGridTarget; storage.AObject := getGridTarget;
storage.StoreAnyProperty(src_prop); storage.StoreAnyProperty(src_prop);
for i:= 0 to fProj.OptionsCollection.Count-1 do for i:= 0 to fProj.OptionsCollection.Count-1 do
begin begin
// skip current config // skip current config
if i = fProj.ConfigurationIndex then continue; if i = fProj.ConfigurationIndex then
continue;
// find target persistent // find target persistent
if inspector.TIObject = fProj.currentConfiguration.messagesOptions then if inspector.TIObject = fProj.currentConfiguration.messagesOptions then
trg_obj := fProj.configuration[i].messagesOptions else trg_obj := fProj.configuration[i].messagesOptions else
@ -273,22 +284,23 @@ var
nme: string; nme: string;
cfg: TCompilerConfiguration; cfg: TCompilerConfiguration;
begin begin
if fProj.isNil then exit; if fProj.isNil then
// exit;
nme := ''; nme := '';
beginImperativeUpdate; beginImperativeUpdate;
cfg := fProj.addConfiguration; cfg := fProj.addConfiguration;
// note: Cancel is actually related to the conf. name not to the add operation. // note: Cancel is actually related to the conf. name not to the add operation.
if InputQuery('Configuration name', '', nme) then cfg.name := nme; if InputQuery('Configuration name', '', nme) then
cfg.name := nme;
fProj.ConfigurationIndex := cfg.Index; fProj.ConfigurationIndex := cfg.Index;
endImperativeUpdate; endImperativeUpdate;
end; end;
procedure TProjectConfigurationWidget.btnDelConfClick(Sender: TObject); procedure TProjectConfigurationWidget.btnDelConfClick(Sender: TObject);
begin begin
if fProj.isNil then exit; if fProj.isNil or (fProj.OptionsCollection.Count = 1) then
if fProj.OptionsCollection.Count = 1 then exit; exit;
//
beginImperativeUpdate; beginImperativeUpdate;
inspector.TIObject := nil; inspector.TIObject := nil;
inspector.Clear; inspector.Clear;
@ -303,15 +315,16 @@ var
nme: string; nme: string;
trg, src: TCompilerConfiguration; trg, src: TCompilerConfiguration;
begin begin
if fProj.isNil then exit; if fProj.isNil then
// exit;
nme := ''; nme := '';
beginImperativeUpdate; beginImperativeUpdate;
fProj.beginUpdate; fProj.beginUpdate;
src := fProj.currentConfiguration; src := fProj.currentConfiguration;
trg := fProj.addConfiguration; trg := fProj.addConfiguration;
trg.assign(src); trg.assign(src);
if InputQuery('Configuration name', '', nme) then trg.name := nme; if InputQuery('Configuration name', '', nme) then
trg.name := nme;
fProj.ConfigurationIndex := trg.Index; fProj.ConfigurationIndex := trg.Index;
fProj.endUpdate; fProj.endUpdate;
endImperativeUpdate; endImperativeUpdate;
@ -321,15 +334,16 @@ procedure TProjectConfigurationWidget.btnSyncEditClick(Sender: TObject);
begin begin
fSynchroValue.Clear; fSynchroValue.Clear;
fSynchroItem.Clear; fSynchroItem.Clear;
if fProj.isNil then exit; if fProj.isNil then
exit;
syncroMode := not syncroMode; syncroMode := not syncroMode;
end; end;
procedure TProjectConfigurationWidget.GridFilter(Sender: TObject; aEditor: TPropertyEditor; procedure TProjectConfigurationWidget.GridFilter(Sender: TObject; aEditor: TPropertyEditor;
var aShow: boolean); var aShow: boolean);
begin begin
if fProj.isNil then exit; if fProj.isNil then
exit;
// filter TComponent things. // filter TComponent things.
if getGridTarget = fProj then if getGridTarget = fProj then
begin begin
@ -371,9 +385,8 @@ end;
function TProjectConfigurationWidget.getGridTarget: TPersistent; function TProjectConfigurationWidget.getGridTarget: TPersistent;
begin begin
if fProj.isNil then exit(nil); if fProj.isNil or (fProj.ConfigurationIndex = -1) or Tree.Selected.isNil then
if fProj.ConfigurationIndex = -1 then exit(nil); exit(nil);
if Tree.Selected.isNil then exit(nil);
// Warning: TTreeNode.StateIndex is usually made for the images...it's not a tag // Warning: TTreeNode.StateIndex is usually made for the images...it's not a tag
case Tree.Selected.StateIndex of case Tree.Selected.StateIndex of
1: exit( fProj ); 1: exit( fProj );
@ -398,8 +411,9 @@ begin
selConf.ItemIndex:= -1; selConf.ItemIndex:= -1;
selConf.Clear; selConf.Clear;
selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isNotNil; selconf.Enabled := (inspector.TIObject <> fProj) and fProj.isNotNil;
if fProj.isNil then exit; if fProj.isNil then
// exit;
for i:= 0 to fProj.OptionsCollection.Count-1 do for i:= 0 to fProj.OptionsCollection.Count-1 do
selConf.Items.Add(fProj.configuration[i].name); selConf.Items.Add(fProj.configuration[i].name);
selConf.ItemIndex := fProj.ConfigurationIndex; selConf.ItemIndex := fProj.ConfigurationIndex;

View File

@ -236,7 +236,7 @@ type
function exeFullName(fname: string): string; function exeFullName(fname: string): string;
(** (**
* Clears then fills aList with aProcess output stream. * Clears and fills aList with aProcess output stream.
*) *)
procedure processOutputToStrings(process: TProcess; list: TStrings); procedure processOutputToStrings(process: TProcess; list: TStrings);
@ -812,7 +812,7 @@ begin
try try
repeat repeat
tryAdd; tryAdd;
if recursive then if isFolder(sr) then if recursive and isFolder(sr) then
listFiles(list, path + directorySeparator + sr.Name, recursive); listFiles(list, path + directorySeparator + sr.Name, recursive);
until until
findNext(sr) <> 0; findNext(sr) <> 0;
@ -869,8 +869,9 @@ begin
pth := path[1..path.length-1]; pth := path[1..path.length-1];
if pth[pth.length] in ['/', '\'] then if pth[pth.length] in ['/', '\'] then
pth := pth[1..pth.length-1]; pth := pth[1..pth.length-1];
if not pth.dirExists then exit(false); if not pth.dirExists then
// exit(false);
files := TStringList.Create; files := TStringList.Create;
try try
listFiles(files, pth, true); listFiles(files, pth, true);
@ -1132,7 +1133,8 @@ var
cnt: integer; cnt: integer;
begin begin
result := ''; result := '';
if files.Count = 0 then exit; if files.Count = 0 then
exit;
sink := TStringList.Create; sink := TStringList.Create;
try try
sink.Assign(files); sink.Assign(files);
@ -1360,7 +1362,8 @@ var
str: string = ''; str: string = '';
begin begin
if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) and not if (proc.ExitStatus <> 0) and (poUsePipes in proc.Options) and not
(poStderrToOutPut in proc.Options) then with TStringList.Create do (poStderrToOutPut in proc.Options) then
with TStringList.Create do
try try
LoadFromStream(proc.Stderr); LoadFromStream(proc.Stderr);
Insert(0, format('%s crashed with code: %d', Insert(0, format('%s crashed with code: %d',

View File

@ -347,7 +347,8 @@ end;
procedure TDexedPageControl.tabsChanging(Sender: TObject; var AllowChange: Boolean); procedure TDexedPageControl.tabsChanging(Sender: TObject; var AllowChange: Boolean);
begin begin
if assigned(fOnChanging) then fOnChanging(self, AllowChange); if assigned(fOnChanging) then
fOnChanging(self, AllowChange);
end; end;
procedure TDexedPageControl.hidePage(index: integer); procedure TDexedPageControl.hidePage(index: integer);

View File

@ -141,13 +141,16 @@ const
begin begin
result := inherited Compare(range); result := inherited Compare(range);
assert(range <> nil); assert(range <> nil);
if result <> 0 then exit; if result <> 0 then
// exit;
if range is TSynD2SynRange then if range is TSynD2SynRange then
begin begin
src_t := TSynD2SynRange(range); src_t := TSynD2SynRange(range);
if src_t.rangeKinds <> rangeKinds then exit(1); if src_t.rangeKinds <> rangeKinds then
if src_t.rString <> rString then exit(1); exit(1);
if src_t.rString <> rString then
exit(1);
if src_t.nestedCommentsCount <> nestedCommentsCount then if src_t.nestedCommentsCount <> nestedCommentsCount then
exit(cmpRes[src_t.nestedCommentsCount > nestedCommentsCount]); exit(cmpRes[src_t.nestedCommentsCount > nestedCommentsCount]);
if src_t.namedRegionCount <> namedRegionCount then if src_t.namedRegionCount <> namedRegionCount then
@ -421,17 +424,18 @@ begin
fTokStop := fTokStart; fTokStop := fTokStart;
// EOL // EOL
if fTokStop > length(fLineBuf) then exit; if fTokStop > length(fLineBuf) then
exit;
readerReset; readerReset;
// script line // script line
if LineIndex = 0 then if fTokStart = 1 then if (LineIndex = 0) and (fTokStart = 1) and readDelim(reader, fTokStop, '#!') then
if readDelim(reader, fTokStop, '#!') then begin
begin fTokKind := tkCommt;
fTokKind := tkCommt; readLine(reader, fTokStop);
readLine(reader, fTokStop); exit;
exit; end
end else readerReset; else readerReset;
// spaces // spaces
if (isWhite(reader^)) then if (isWhite(reader^)) then
@ -449,8 +453,8 @@ begin
fCurrRange := TSynD2SynRange.Create(nil); fCurrRange := TSynD2SynRange.Create(nil);
// line comments / region beg-end // line comments / region beg-end
if (fCurrRange.rangeKinds = []) or (fCurrRange.rangeKinds = [rkAsm]) if (fCurrRange.rangeKinds = []) or (fCurrRange.rangeKinds = [rkAsm]) then
then if readDelim(reader, fTokStop, '//') then if readDelim(reader, fTokStop, '//') then
begin begin
fTokKind := tkCommt; fTokKind := tkCommt;
if readDelim(reader, fTokStop, '/') then if readDelim(reader, fTokStop, '/') then
@ -486,8 +490,10 @@ begin
begin begin
fTokKind := tkCommt; fTokKind := tkCommt;
if readDelim(reader, fTokStop, '*') then if readDelim(reader, fTokStop, '*') then
if readDelim(reader, fTokStop, '/') then exit if readDelim(reader, fTokStop, '/') then
else fTokKind := tkDDocs; exit
else
fTokKind := tkDDocs;
if readUntil(reader, fTokStop, '*/') then if readUntil(reader, fTokStop, '*/') then
exit; exit;
if fTokKind = tkDDocs then if fTokKind = tkDDocs then
@ -503,8 +509,10 @@ begin
end else readerReset; end else readerReset;
if (rkBlockCom1 in fCurrRange.rangeKinds) or (rkBlockDoc1 in fCurrRange.rangeKinds) then if (rkBlockCom1 in fCurrRange.rangeKinds) or (rkBlockDoc1 in fCurrRange.rangeKinds) then
begin begin
if (rkBlockDoc1 in fCurrRange.rangeKinds) then fTokKind := tkDDocs if (rkBlockDoc1 in fCurrRange.rangeKinds) then
else fTokKind := tkCommt; fTokKind := tkDDocs
else
fTokKind := tkCommt;
if readUntil(reader, fTokStop, '*/') then if readUntil(reader, fTokStop, '*/') then
begin begin
if (fTokKind = tkCommt) then if (fTokKind = tkCommt) then
@ -565,8 +573,10 @@ begin
end else readerReset; end else readerReset;
if (rkBlockCom2 in fCurrRange.rangeKinds) or (rkBlockDoc2 in fCurrRange.rangeKinds) then if (rkBlockCom2 in fCurrRange.rangeKinds) or (rkBlockDoc2 in fCurrRange.rangeKinds) then
begin begin
if (rkBlockDoc2 in fCurrRange.rangeKinds) then fTokKind := tkDDocs if (rkBlockDoc2 in fCurrRange.rangeKinds) then
else fTokKind := tkCommt; fTokKind := tkDDocs
else
fTokKind := tkCommt;
while (reader^ <> #10) and (fCurrRange.nestedCommentsCount > 0) do while (reader^ <> #10) and (fCurrRange.nestedCommentsCount > 0) do
begin begin
if readUntilAmong(reader, fTokStop, ['+', '/']) then if readUntilAmong(reader, fTokStop, ['+', '/']) then
@ -616,13 +626,15 @@ begin
fTokKind := tkStrng; fTokKind := tkStrng;
while(true) do while(true) do
begin begin
if not readUntilAmong(reader, fTokStop, stringStopChecks) then break; if not readUntilAmong(reader, fTokStop, stringStopChecks) then
break;
if (reader^ = '\') then if (reader^ = '\') then
begin begin
readerNext; readerNext;
if reader^ <> #10 then if reader^ <> #10 then
begin begin
if fCurrRange.rString then continue; if fCurrRange.rString then
continue;
readerNext; readerNext;
end; end;
end end
@ -643,13 +655,15 @@ begin
fTokKind := tkStrng; fTokKind := tkStrng;
while(true) do while(true) do
begin begin
if not readUntilAmong(reader, fTokStop, stringStopChecks) then break; if not readUntilAmong(reader, fTokStop, stringStopChecks) then
break;
if reader^ = '\' then if reader^ = '\' then
begin begin
readerNext; readerNext;
if reader^ <> #10 then if reader^ <> #10 then
begin begin
if fCurrRange.rString then continue; if fCurrRange.rString then
continue;
readerNext; readerNext;
end; end;
end end
@ -728,7 +742,8 @@ begin
end else readerReset; end else readerReset;
// bin & hex literals // bin & hex literals
if reader^ = '0' then if readerNext^ in ['b','B', 'x', 'X'] then if reader^ = '0' then
if readerNext^ in ['b','B', 'x', 'X'] then
begin begin
fTokKind:= tkNumbr; fTokKind:= tkNumbr;
readerNext; readerNext;
@ -736,18 +751,18 @@ begin
readWhile(reader, fTokStop, ['0','1','_']) readWhile(reader, fTokStop, ['0','1','_'])
else else
readWhile(reader, fTokStop, hexaChars + ['.']); readWhile(reader, fTokStop, hexaChars + ['.']);
// exponent, sign tokenized later as op then value as number // exponent, sign tokenized later as op and the value as number
if reader^ in ['P','p'] then if reader^ in ['P','p'] then
begin begin
readerNext; readerNext;
exit; exit;
end; end;
if not tryReadDelim(reader, fTokStop, 'uL') if not tryReadDelim(reader, fTokStop, 'uL')
then if not tryReadDelim(reader, fTokStop, 'UL') and not tryReadDelim(reader, fTokStop, 'UL')
then if not tryReadDelim(reader, fTokStop, 'Lu') and not tryReadDelim(reader, fTokStop, 'Lu')
then if not tryReadDelim(reader, fTokStop, 'LU') and not tryReadDelim(reader, fTokStop, 'LU')
then if reader^ in ['U', 'L', 'u', 'i'] then and (reader^ in ['U', 'L', 'u', 'i']) then
readerNext; readerNext;
if not isWhite(reader^) and not isOperator1(reader^) and if not isWhite(reader^) and not isOperator1(reader^) and
not isSymbol(reader^) then not isSymbol(reader^) then
begin begin
@ -801,22 +816,22 @@ begin
end; end;
readerPrev; readerPrev;
end; end;
// exponent, sign tokenized later as op then value as number // exponent, sign tokenized later as op and the value as number
if reader^ in ['E','e'] then if reader^ in ['E','e'] then
begin begin
readerNext; readerNext;
exit; exit;
end; end;
// try valid suffixes // try valid suffixes
if not tryReadDelim(reader, fTokStop, 'uL') if not tryReadDelim(reader, fTokStop, 'uL')
then if not tryReadDelim(reader, fTokStop, 'UL') and not tryReadDelim(reader, fTokStop, 'UL')
then if not tryReadDelim(reader, fTokStop, 'Lu') and not tryReadDelim(reader, fTokStop, 'Lu')
then if not tryReadDelim(reader, fTokStop, 'LU') and not tryReadDelim(reader, fTokStop, 'LU')
then if not tryReadDelim(reader, fTokStop, 'fi') and not tryReadDelim(reader, fTokStop, 'fi')
then if not tryReadDelim(reader, fTokStop, 'Fi') and not tryReadDelim(reader, fTokStop, 'Fi')
then if not tryReadDelim(reader, fTokStop, 'Li') and not tryReadDelim(reader, fTokStop, 'Li')
then if reader^ in ['U','L','u', 'i', 'f','F'] then and (reader^ in ['U','L','u', 'i', 'f','F']) then
readerNext; readerNext;
if not isWhite(reader^) and not isOperator1(reader^) and if not isWhite(reader^) and not isOperator1(reader^) and
(not isSymbol(reader^) or (reader^ = '.')) then (not isSymbol(reader^) or (reader^ = '.')) then
begin begin
@ -952,7 +967,8 @@ begin
exit; exit;
end; end;
if fLineBuf[fTokStop] = #10 then exit; if fLineBuf[fTokStop] = #10 then
exit;
readUntilAmong(reader, fTokStop, [#9, #10, ' ']); readUntilAmong(reader, fTokStop, [#9, #10, ' ']);
fTokKind := tkError; fTokKind := tkError;

View File

@ -297,12 +297,14 @@ end;
procedure TDcdWrapper.docChanged(document: TDexedMemo); procedure TDcdWrapper.docChanged(document: TDexedMemo);
begin begin
if fDoc <> document then exit; if fDoc <> document then
exit;
end; end;
procedure TDcdWrapper.docClosing(document: TDexedMemo); procedure TDcdWrapper.docClosing(document: TDexedMemo);
begin begin
if fDoc <> document then exit; if fDoc <> document then
exit;
fDoc := nil; fDoc := nil;
end; end;
{$ENDREGION} {$ENDREGION}
@ -510,7 +512,8 @@ begin
updateServerlistening; updateServerlistening;
exit; exit;
end; end;
if not (fTempLines[0] = 'calltips') then exit; if not (fTempLines[0] = 'calltips') then
exit;
fTempLines.Delete(0); fTempLines.Delete(0);
tips := fTempLines.Text; tips := fTempLines.Text;
@ -561,7 +564,8 @@ begin
updateServerlistening; updateServerlistening;
exit; exit;
end; end;
if not (fTempLines[0] = 'identifiers') then exit; if not (fTempLines[0] = 'identifiers') then
exit;
list.Clear; list.Clear;
for i := 1 to fTempLines.Count-1 do for i := 1 to fTempLines.Count-1 do
@ -607,7 +611,8 @@ begin
exit; exit;
i := fDoc.MouseBytePosition; i := fDoc.MouseBytePosition;
if i = 0 then exit; if i = 0 then
exit;
terminateClient; terminateClient;
fClient.Parameters.Clear; fClient.Parameters.Clear;

View File

@ -244,8 +244,8 @@ end;
procedure TDfmtWidget.docFocused(document: TDexedMemo); procedure TDfmtWidget.docFocused(document: TDexedMemo);
begin begin
if document = fDoc if document = fDoc then
then exit; exit;
fDoc := document; fDoc := document;
end; end;

View File

@ -344,7 +344,8 @@ var
begin begin
if text = '' then exit; if text = '' then
exit;
noComment := lxoNoComments in Options; noComment := lxoNoComments in Options;
@ -684,7 +685,8 @@ begin
else if (expSet) then else if (expSet) then
while reader.Next^ in ['0'..'9', '_'] do while reader.Next^ in ['0'..'9', '_'] do
identifier += reader.head^; identifier += reader.head^;
if not expSet then expSet:= reader.head^ in ['p','P']; if not expSet then
expSet:= reader.head^ in ['p','P'];
if (expSet) then if (expSet) then
while reader.Next^ in ['0'..'9', '_'] do while reader.Next^ in ['0'..'9', '_'] do
identifier += reader.head^; identifier += reader.head^;
@ -771,8 +773,10 @@ begin
identifier += reader.head^; identifier += reader.head^;
end; end;
expSet := reader.head^ in ['e','E']; expSet := reader.head^ in ['e','E'];
if expSet then identifier += reader.head^; if expSet then
if decSet then while isNumber(reader.Next^) or (reader.head^ = '_') do identifier += reader.head^;
if decSet then
while isNumber(reader.Next^) or (reader.head^ = '_') do
begin begin
if isOutOfBound then if isOutOfBound then
exit; exit;
@ -781,9 +785,11 @@ begin
if not expSet then if not expSet then
begin begin
expSet := reader.head^ in ['e','E']; expSet := reader.head^ in ['e','E'];
if expSet then identifier += reader.head^; if expSet then
identifier += reader.head^;
end; end;
if expSet then while isNumber(reader.Next^) or (reader.head^ = '_') do if expSet then
while isNumber(reader.Next^) or (reader.head^ = '_') do
begin begin
if isOutOfBound then if isOutOfBound then
exit; exit;

View File

@ -393,7 +393,8 @@ end;
procedure TOptsGroup.doChanged; procedure TOptsGroup.doChanged;
begin begin
if assigned(fOnChange) then fOnChange(self); if assigned(fOnChange) then
fOnChange(self);
end; end;
{$REGION TDocOpts --------------------------------------------------------------} {$REGION TDocOpts --------------------------------------------------------------}
@ -440,7 +441,6 @@ begin
if (source is TDocOpts) then if (source is TDocOpts) then
begin begin
src := TDocOpts(source); src := TDocOpts(source);
//
fGenDoc := src.fGenDoc; fGenDoc := src.fGenDoc;
fGenJson := src.fGenJson; fGenJson := src.fGenJson;
fDocDir := patchPlateformPath(src.fDocDir); fDocDir := patchPlateformPath(src.fDocDir);
@ -456,7 +456,6 @@ begin
fGenDoc := true; fGenDoc := true;
exit; exit;
end; end;
//
if fGenDoc = value then if fGenDoc = value then
exit; exit;
fGenDoc := value; fGenDoc := value;
@ -470,7 +469,6 @@ begin
fGenJson := true; fGenJson := true;
exit; exit;
end; end;
//
if fGenJson = value then if fGenJson = value then
exit; exit;
fGenJson := value; fGenJson := value;
@ -516,27 +514,45 @@ begin
if base.isNil then if base.isNil then
begin begin
dep := DepStr[fDepHandling]; dep := DepStr[fDepHandling];
if dep.isNotEmpty then list.Add(dep); if dep.isNotEmpty then
if fVerbose then list.Add('-v'); list.Add(dep);
if fWarnings then list.Add('-w'); if fVerbose then
if fWarnInfo then list.Add('-wi'); list.Add('-v');
if fVtls then list.Add('-vtls'); if fWarnings then
if fQuiet then list.Add('-quiet'); list.Add('-w');
if fVgc then list.Add('-vgc'); if fWarnInfo then
if fCol then list.Add('-vcolumns'); list.Add('-wi');
if fVtls then
list.Add('-vtls');
if fQuiet then
list.Add('-quiet');
if fVgc then
list.Add('-vgc');
if fCol then
list.Add('-vcolumns');
end else end else
begin begin
baseopt := TMsgOpts(base); baseopt := TMsgOpts(base);
dep := DepStr[fDepHandling]; dep := DepStr[fDepHandling];
depbase := DepStr[baseopt.fDepHandling]; depbase := DepStr[baseopt.fDepHandling];
if dep <> depbase then list.Add(dep) else list.Add(depbase); if dep <> depbase then
if baseopt.fVerbose or fVerbose then list.Add('-v'); list.Add(dep)
if baseopt.fWarnings or fWarnings then list.Add('-w'); else
if baseopt.fWarnInfo or fWarnInfo then list.Add('-wi'); list.Add(depbase);
if baseopt.fVtls or fVtls then list.Add('-vtls'); if baseopt.fVerbose or fVerbose then
if baseopt.fQuiet or fQuiet then list.Add('-quiet'); list.Add('-v');
if baseopt.fVgc or fVgc then list.Add('-vgc'); if baseopt.fWarnings or fWarnings then
if baseopt.fCol or fCol then list.Add('-vcolumns'); list.Add('-w');
if baseopt.fWarnInfo or fWarnInfo then
list.Add('-wi');
if baseopt.fVtls or fVtls then
list.Add('-vtls');
if baseopt.fQuiet or fQuiet then
list.Add('-quiet');
if baseopt.fVgc or fVgc then
list.Add('-vgc');
if baseopt.fCol or fCol then
list.Add('-vcolumns');
end; end;
end; end;
@ -562,56 +578,64 @@ end;
procedure TMsgOpts.setDepHandling(const value: TDepHandling); procedure TMsgOpts.setDepHandling(const value: TDepHandling);
begin begin
if fDepHandling = value then exit; if fDepHandling = value then
exit;
fDepHandling := value; fDepHandling := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setVerbose(const value: boolean); procedure TMsgOpts.setVerbose(const value: boolean);
begin begin
if fVerbose = value then exit; if fVerbose = value then
exit;
fVerbose := value; fVerbose := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setWarnings(const value: boolean); procedure TMsgOpts.setWarnings(const value: boolean);
begin begin
if fWarnings = value then exit; if fWarnings = value then
exit;
fWarnings := value; fWarnings := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setWarnInfo(const value: boolean); procedure TMsgOpts.setWarnInfo(const value: boolean);
begin begin
if fWarnInfo = value then exit; if fWarnInfo = value then
exit;
fWarnInfo := value; fWarnInfo := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setVtls(const value: boolean); procedure TMsgOpts.setVtls(const value: boolean);
begin begin
if fVtls = value then exit; if fVtls = value then
exit;
fVtls := value; fVtls := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setQuiet(const value: boolean); procedure TMsgOpts.setQuiet(const value: boolean);
begin begin
if fQuiet = value then exit; if fQuiet = value then
exit;
fQuiet := value; fQuiet := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setVgc(const value: boolean); procedure TMsgOpts.setVgc(const value: boolean);
begin begin
if fVgc = value then exit; if fVgc = value then
exit;
fVgc := value; fVgc := value;
doChanged; doChanged;
end; end;
procedure TMsgOpts.setCol(const value: boolean); procedure TMsgOpts.setCol(const value: boolean);
begin begin
if fCol = value then exit; if fCol = value then
exit;
fCol := value; fCol := value;
doChanged; doChanged;
end; end;
@ -643,23 +667,32 @@ begin
if base.isNil then if base.isNil then
begin begin
str := binKindStr[fBinKind]; str := binKindStr[fBinKind];
if str.isNotEmpty then list.Add(str); if str.isNotEmpty then
list.Add(str);
{$IFNDEF WINDOWS} {$IFNDEF WINDOWS}
if fBinKind = sharedlib then if fBinKind = sharedlib then
list.Add('-fPIC'); list.Add('-fPIC');
{$ENDIF} {$ENDIF}
str := trgKindStr[fTrgKind]; str := trgKindStr[fTrgKind];
if str.isNotEmpty then list.Add(str); if str.isNotEmpty then
if fUnittest then list.Add('-unittest'); list.Add(str);
if fInline then list.Add('-inline'); if fUnittest then
if fOptimz then list.Add('-O'); list.Add('-unittest');
if fStackStomp then list.Add('-gx'); if fInline then
if fAllInst then list.Add('-allinst'); list.Add('-inline');
if fAddMain then list.Add('-main'); if fOptimz then
if fRelease then list.Add('-release'); list.Add('-O');
if fStackStomp then
list.Add('-gx');
if fAllInst then
list.Add('-allinst');
if fAddMain then
list.Add('-main');
if fRelease then
list.Add('-release');
for str in fVerIds do for str in fVerIds do
if not isStringDisabled(str) then list.Add('-version=' + str); if not isStringDisabled(str) then
// list.Add('-version=' + str);
if fRelease then if fRelease then
begin begin
if fBoundsCheck <> safeOnly then if fBoundsCheck <> safeOnly then
@ -691,18 +724,32 @@ begin
end; end;
str := trgKindStr[fTrgKind]; str := trgKindStr[fTrgKind];
strbase := trgKindStr[baseopt.fTrgKind]; strbase := trgKindStr[baseopt.fTrgKind];
if (str <> strbase) then list.Add(str) else list.Add(strbase); if (str <> strbase) then
if baseopt.fUnittest or fUnittest then list.Add('-unittest'); list.Add(str)
if baseopt.fInline or fInline then list.Add('-inline'); else
if baseopt.fOptimz or fOptimz then list.Add('-O'); list.Add(strbase);
if baseopt.fStackStomp or fStackStomp then list.Add('-gx'); if baseopt.fUnittest or fUnittest then
if baseopt.fAllInst or fAllInst then list.Add('-allinst'); list.Add('-unittest');
if baseopt.fAddMain or fAddMain then list.Add('-main'); if baseopt.fInline or fInline then
if baseopt.fRelease or fRelease then list.Add('-release'); list.Add('-inline');
if (fVerIds.Count = 0) then for str in baseopt.fVerIds do begin if baseopt.fOptimz or fOptimz then
if not isStringDisabled(str) then list.Add('-version=' + str); list.Add('-O');
if baseopt.fStackStomp or fStackStomp then
list.Add('-gx');
if baseopt.fAllInst or fAllInst then
list.Add('-allinst');
if baseopt.fAddMain or fAddMain then
list.Add('-main');
if baseopt.fRelease or fRelease then
list.Add('-release');
if (fVerIds.Count = 0) then
for str in baseopt.fVerIds do
begin
if not isStringDisabled(str) then
list.Add('-version=' + str);
end else for str in fVerIds do end else for str in fVerIds do
if not isStringDisabled(str) then list.Add('-version=' + str); if not isStringDisabled(str) then
list.Add('-version=' + str);
// default values are not handled here, TODO // default values are not handled here, TODO
if fBoundsCheck <> baseopt.fBoundsCheck then if fBoundsCheck <> baseopt.fBoundsCheck then
list.Add('-boundscheck=' + bchKindStr[fBoundsCheck] ) list.Add('-boundscheck=' + bchKindStr[fBoundsCheck] )
@ -718,7 +765,6 @@ begin
if (source is TOutputOpts) then if (source is TOutputOpts) then
begin begin
src := TOutputOpts(source); src := TOutputOpts(source);
//
fVerIds.Assign(src.fVerIds); fVerIds.Assign(src.fVerIds);
fBinKind := src.fBinKind; fBinKind := src.fBinKind;
fTrgKind := src.fTrgKind; fTrgKind := src.fTrgKind;
@ -738,21 +784,24 @@ end;
procedure TOutputOpts.setUnittest(const value: boolean); procedure TOutputOpts.setUnittest(const value: boolean);
begin begin
if fUnittest = value then exit; if fUnittest = value then
exit;
fUnittest := value; fUnittest := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setAllInst(const value: boolean); procedure TOutputOpts.setAllInst(const value: boolean);
begin begin
if fAllinst = value then exit; if fAllinst = value then
exit;
fAllinst := value; fAllinst := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setAlwaysLinkLibs(const value: boolean); procedure TOutputOpts.setAlwaysLinkLibs(const value: boolean);
begin begin
if fAlwayLinkLibs = value then exit; if fAlwayLinkLibs = value then
exit;
fAlwayLinkLibs := value; fAlwayLinkLibs := value;
doChanged; doChanged;
end; end;
@ -765,63 +814,72 @@ end;
procedure TOutputOpts.setTrgKind(const value: TTargetSystem); procedure TOutputOpts.setTrgKind(const value: TTargetSystem);
begin begin
if fTrgKind = value then exit; if fTrgKind = value then
exit;
fTrgKind := value; fTrgKind := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setBinKind(const value: TProjectBinaryKind); procedure TOutputOpts.setBinKind(const value: TProjectBinaryKind);
begin begin
if fBinKind = value then exit; if fBinKind = value then
exit;
fBinKind := value; fBinKind := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setInline(const value: boolean); procedure TOutputOpts.setInline(const value: boolean);
begin begin
if fInline = value then exit; if fInline = value then
exit;
fInline := value; fInline := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setBoundsCheck(const value: TBoundCheckKind); procedure TOutputOpts.setBoundsCheck(const value: TBoundCheckKind);
begin begin
if fBoundsCheck = value then exit; if fBoundsCheck = value then
exit;
fBoundsCheck := value; fBoundsCheck := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setOptims(const value: boolean); procedure TOutputOpts.setOptims(const value: boolean);
begin begin
if fOptimz = value then exit; if fOptimz = value then
exit;
fOptimz := value; fOptimz := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setGenStack(const value: boolean); procedure TOutputOpts.setGenStack(const value: boolean);
begin begin
if fGenStack = value then exit; if fGenStack = value then
exit;
fGenStack := value; fGenStack := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setAddMain(const value: boolean); procedure TOutputOpts.setAddMain(const value: boolean);
begin begin
if fAddMain = value then exit; if fAddMain = value then
exit;
fAddMain := value; fAddMain := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setRelease(const value: boolean); procedure TOutputOpts.setRelease(const value: boolean);
begin begin
if fRelease = value then exit; if fRelease = value then
exit;
fRelease := value; fRelease := value;
doChanged; doChanged;
end; end;
procedure TOutputOpts.setStackStomp(const value: boolean); procedure TOutputOpts.setStackStomp(const value: boolean);
begin begin
if fStackStomp = value then exit; if fStackStomp = value then
exit;
fStackStomp := value; fStackStomp := value;
doChanged; doChanged;
end; end;
@ -847,30 +905,42 @@ var
begin begin
if base.isNil then if base.isNil then
begin begin
if fDebugConditions then list.Add('-debug'); if fDebugConditions then
list.Add('-debug');
if fDbgLevel <> 0 then if fDbgLevel <> 0 then
list.Add('-debug=' + intToStr(fDbgLevel)); list.Add('-debug=' + intToStr(fDbgLevel));
for idt in fDbgIdents do for idt in fDbgIdents do
list.Add('-debug=' + idt); list.Add('-debug=' + idt);
if fGenInfos then list.Add('-g'); if fGenInfos then
if fDbgC then list.Add('-gc'); list.Add('-g');
if fGenMap then list.Add('-map'); if fDbgC then
if fGenFrame and (list.IndexOf('-gs') = -1) then list.Add('-gs'); list.Add('-gc');
if fGenMap then
list.Add('-map');
if fGenFrame and (list.IndexOf('-gs') = -1) then
list.Add('-gs');
end else end else
begin begin
baseopt := TDebugOpts(base); baseopt := TDebugOpts(base);
if baseopt.fDebugConditions or fDebugConditions then list.Add('-debug'); if baseopt.fDebugConditions or fDebugConditions then
list.Add('-debug');
if (baseopt.fDbgLevel <> 0) and (fDbgLevel = 0) then if (baseopt.fDbgLevel <> 0) and (fDbgLevel = 0) then
list.Add('-debug=' + intToStr(baseopt.fDbgLevel)) list.Add('-debug=' + intToStr(baseopt.fDbgLevel))
else if fDbgLevel <> 0 then else if fDbgLevel <> 0 then
list.Add('-debug=' + intToStr(fDbgLevel)); list.Add('-debug=' + intToStr(fDbgLevel));
if fDbgIdents.Count = 0 then if fDbgIdents.Count = 0 then
for idt in baseopt.fDbgIdents do list.Add('-debug=' + idt) for idt in baseopt.fDbgIdents do
else for idt in fDbgIdents do list.Add('-debug=' + idt); list.Add('-debug=' + idt)
if baseopt.fGenInfos or fGenInfos then list.Add('-g'); else for idt in fDbgIdents do
if baseopt.fDbgC or fDbgC then list.Add('-gc'); list.Add('-debug=' + idt);
if baseopt.fGenMap or fGenMap then list.Add('-map'); if baseopt.fGenInfos or fGenInfos then
if (baseopt.fGenFrame or fGenFrame) and (list.IndexOf('-gs') = -1) then list.Add('-gs'); list.Add('-g');
if baseopt.fDbgC or fDbgC then
list.Add('-gc');
if baseopt.fGenMap or fGenMap then
list.Add('-map');
if (baseopt.fGenFrame or fGenFrame) and (list.IndexOf('-gs') = -1) then
list.Add('-gs');
end; end;
end; end;
@ -881,7 +951,6 @@ begin
if (source is TDebugOpts) then if (source is TDebugOpts) then
begin begin
src := TDebugOpts(source); src := TDebugOpts(source);
//
fDbgIdents.Assign(src.fDbgIdents); fDbgIdents.Assign(src.fDbgIdents);
fDebugConditions := src.fDebugConditions; fDebugConditions := src.fDebugConditions;
fDbgLevel := src.fDbgLevel; fDbgLevel := src.fDbgLevel;
@ -896,7 +965,8 @@ end;
procedure TDebugOpts.updateForceDbgBool; procedure TDebugOpts.updateForceDbgBool;
begin begin
fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0); fForceDbgBool := (fDbgLevel > 0) or (fDbgIdents.Count > 0);
if fForceDbgBool then setDebugConditions(true); if fForceDbgBool then
setDebugConditions(true);
end; end;
procedure TDebugOpts.setDebugConditions(const value: boolean); procedure TDebugOpts.setDebugConditions(const value: boolean);
@ -906,44 +976,51 @@ begin
fDebugConditions := true; fDebugConditions := true;
exit; exit;
end; end;
if fDebugConditions = value then exit; if fDebugConditions = value then
exit;
fDebugConditions := value; fDebugConditions := value;
doChanged; doChanged;
end; end;
procedure TDebugOpts.setGenFrame(const value: boolean); procedure TDebugOpts.setGenFrame(const value: boolean);
begin begin
if fGenFrame = value then exit; if fGenFrame = value then
exit;
fGenFrame:=value; fGenFrame:=value;
doChanged; doChanged;
end; end;
procedure TDebugOpts.setGenInfos(const value: boolean); procedure TDebugOpts.setGenInfos(const value: boolean);
begin begin
if fGenInfos = value then exit; if fGenInfos = value then
exit;
fGenInfos := value; fGenInfos := value;
doChanged; doChanged;
end; end;
procedure TDebugOpts.setDbgC(const value: boolean); procedure TDebugOpts.setDbgC(const value: boolean);
begin begin
if fDbgC = value then exit; if fDbgC = value then
exit;
fDbgC := value; fDbgC := value;
doChanged; doChanged;
end; end;
procedure TDebugOpts.setGenMap(const value: boolean); procedure TDebugOpts.setGenMap(const value: boolean);
begin begin
if fGenMap = value then exit; if fGenMap = value then
exit;
fGenMap := value; fGenMap := value;
doChanged; doChanged;
end; end;
procedure TDebugOpts.setDbgLevel(const value: Integer); procedure TDebugOpts.setDbgLevel(const value: Integer);
begin begin
if fDbgLevel = value then exit; if fDbgLevel = value then
exit;
fDbgLevel := value; fDbgLevel := value;
if fDbgLevel < 0 then fDbgLevel := 0; if fDbgLevel < 0 then
fDbgLevel := 0;
updateForceDbgBool; updateForceDbgBool;
doChanged; doChanged;
end; end;
@ -1036,8 +1113,10 @@ begin
end else end else
begin begin
baseopt := TPathsOpts(base); baseopt := TPathsOpts(base);
if fExtraSrcs.Count = 0 then rightList := baseopt.fExtraSrcs if fExtraSrcs.Count = 0 then
else rightList := fExtraSrcs; rightList := baseopt.fExtraSrcs
else
rightList := fExtraSrcs;
exts := TStringList.Create; exts := TStringList.Create;
try try
exts.AddStrings(['.d', '.di', '.dd']); exts.AddStrings(['.d', '.di', '.dd']);
@ -1053,25 +1132,37 @@ begin
exts.Free; exts.Free;
end; end;
// //
if fImpMod.Count = 0 then rightList := baseopt.fImpMod if fImpMod.Count = 0 then
else rightList := fImpMod; rightList := baseopt.fImpMod
for str in rightList do if not isStringDisabled(str) then else
list.Add('-I'+ fSymStringExpander.expand(str)); rightList := fImpMod;
for str in rightList do
if not isStringDisabled(str) then
list.Add('-I'+ fSymStringExpander.expand(str));
// //
if fImpStr.Count = 0 then rightList := baseopt.fImpStr if fImpStr.Count = 0 then
else rightList := fImpStr; rightList := baseopt.fImpStr
for str in rightList do if not isStringDisabled(str) then else
list.Add('-J'+ fSymStringExpander.expand(str)); rightList := fImpStr;
for str in rightList do
if not isStringDisabled(str) then
list.Add('-J'+ fSymStringExpander.expand(str));
// //
str := ''; str := '';
if fFname <> '' then str := fFname else if fFname <> '' then
if baseopt.fFname <> '' then str := baseopt.fFname; str := fFname
if str.isNotEmpty then list.Add('-of' + fSymStringExpander.expand(str)); else if baseopt.fFname <> '' then
str := baseopt.fFname;
if str.isNotEmpty then
list.Add('-of' + fSymStringExpander.expand(str));
// //
str := ''; str := '';
if fObjDir <> '' then str := fObjDir else if fObjDir <> '' then
if baseopt.fObjDir <> '' then str := baseopt.fObjDir; str := fObjDir
if str.isNotEmpty then list.Add('-od' + fSymStringExpander.expand(str)); else if baseopt.fObjDir <> '' then
str := baseopt.fObjDir;
if str.isNotEmpty then
list.Add('-od' + fSymStringExpander.expand(str));
end; end;
end; end;
@ -1082,7 +1173,7 @@ begin
if (source is TPathsOpts) then if (source is TPathsOpts) then
begin begin
src := TPathsOpts(source); src := TPathsOpts(source);
//
fExtraSrcs.Assign(src.fExtraSrcs); fExtraSrcs.Assign(src.fExtraSrcs);
fImpMod.Assign(src.fImpMod); fImpMod.Assign(src.fImpMod);
fImpStr.Assign(src.fImpStr); fImpStr.Assign(src.fImpStr);
@ -1105,14 +1196,16 @@ end;
procedure TPathsOpts.setForceExt(value: boolean); procedure TPathsOpts.setForceExt(value: boolean);
begin begin
if fForceExt = value then exit; if fForceExt = value then
exit;
fForceExt:=value; fForceExt:=value;
doChanged; doChanged;
end; end;
procedure TPathsOpts.setFname(const value: TFilename); procedure TPathsOpts.setFname(const value: TFilename);
begin begin
if fFname = value then exit; if fFname = value then
exit;
fFname := patchPlateformPath(value); fFname := patchPlateformPath(value);
fFname := patchPlateformExt(fFname); fFname := patchPlateformExt(fFname);
doChanged; doChanged;
@ -1120,7 +1213,8 @@ end;
procedure TPathsOpts.setObjDir(const value: TPathname); procedure TPathsOpts.setObjDir(const value: TPathname);
begin begin
if fObjDir = value then exit; if fObjDir = value then
exit;
fObjDir := patchPlateformPath(value); fObjDir := patchPlateformPath(value);
doChanged; doChanged;
end; end;
@ -1266,7 +1360,8 @@ begin
ldc, ldmd: lst := fLdcOthers; ldc, ldmd: lst := fLdcOthers;
gdc, gdmd: lst := fGdcOthers; gdc, gdmd: lst := fGdcOthers;
end; end;
if lst.isNotNil then for i := 0 to lst.Count-1 do if lst.isNotNil then
for i := 0 to lst.Count-1 do
begin begin
str := lst[i]; str := lst[i];
if str.isEmpty or isStringDisabled(str) then if str.isEmpty or isStringDisabled(str) then
@ -1295,7 +1390,8 @@ begin
else else
lst := fGdcOthers; lst := fGdcOthers;
end; end;
if lst.isNotNil then for i := 0 to lst.Count-1 do if lst.isNotNil then
for i := 0 to lst.Count-1 do
begin begin
str := lst[i]; str := lst[i];
if str.isEmpty or isStringDisabled(str) then if str.isEmpty or isStringDisabled(str) then
@ -1402,21 +1498,24 @@ end;
procedure TCustomProcOptions.setExecutable(const value: TFilename); procedure TCustomProcOptions.setExecutable(const value: TFilename);
begin begin
if fExecutable = value then exit; if fExecutable = value then
exit;
fExecutable := value; fExecutable := value;
doChanged; doChanged;
end; end;
procedure TCustomProcOptions.setWorkDir(const value: TPathname); procedure TCustomProcOptions.setWorkDir(const value: TPathname);
begin begin
if fWorkDir = value then exit; if fWorkDir = value then
exit;
fWorkDir := value; fWorkDir := value;
doChanged; doChanged;
end; end;
procedure TCustomProcOptions.setOptions(const value: TProcessOptions); procedure TCustomProcOptions.setOptions(const value: TProcessOptions);
begin begin
if fOptions = value then exit; if fOptions = value then
exit;
fOptions := value; fOptions := value;
doChanged; doChanged;
end; end;
@ -1435,7 +1534,8 @@ end;
procedure TCustomProcOptions.setShowWin(value: TShowWindowOptions); procedure TCustomProcOptions.setShowWin(value: TShowWindowOptions);
begin begin
if fShowWin = value then exit; if fShowWin = value then
exit;
fShowWin := value; fShowWin := value;
doChanged; doChanged;
end; end;
@ -1549,18 +1649,19 @@ begin
ext := nme.extractFileExt; ext := nme.extractFileExt;
nme := '-of' + nme; nme := '-of' + nme;
i := list.IndexOf(nme); i := list.IndexOf(nme);
if i <> -1 then case fOutputOpts.binaryKind of if i <> -1 then
{$IFDEF WINDOWS} case fOutputOpts.binaryKind of
executable: if ext <> exeExt then {$IFDEF WINDOWS}
list[i] := list[i] + exeExt; executable: if ext <> exeExt then
{$ENDIF} list[i] := list[i] + exeExt;
obj: if ext <> objExt then {$ENDIF}
list[i] := list[i] + objExt; obj: if ext <> objExt then
sharedlib: if ext <> dynExt then list[i] := list[i] + objExt;
list[i] := list[i] + dynExt; sharedlib: if ext <> dynExt then
staticlib: if ext <> libExt then list[i] := list[i] + dynExt;
list[i] := list[i] + libExt; staticlib: if ext <> libExt then
end; list[i] := list[i] + libExt;
end;
end; end;
end; end;
@ -1581,7 +1682,8 @@ end;
procedure TCompilerConfiguration.doChanged; procedure TCompilerConfiguration.doChanged;
begin begin
if assigned(fOnChanged) then fOnChanged(self); if assigned(fOnChanged) then
fOnChanged(self);
end; end;
procedure TCompilerConfiguration.setDocOpts(const value: TDocOpts); procedure TCompilerConfiguration.setDocOpts(const value: TDocOpts);

View File

@ -1256,7 +1256,8 @@ begin
end; end;
fBuildTypes.AddStrings(DubBuiltTypeName); fBuildTypes.AddStrings(DubBuiltTypeName);
if fJSON.findObject('buildTypes', obj) then for i := 0 to obj.Count-1 do if fJSON.findObject('buildTypes', obj) then
for i := 0 to obj.Count-1 do
begin begin
itemname := obj.Names[i]; itemname := obj.Names[i];
// defaults build types can be overridden // defaults build types can be overridden
@ -1335,7 +1336,8 @@ begin
tryAddFromFolder(fBasePath + 'src'); tryAddFromFolder(fBasePath + 'src');
tryAddFromFolder(fBasePath + 'source'); tryAddFromFolder(fBasePath + 'source');
// custom folders // custom folders
if fJSON.findArray('sourcePaths', arr) then for i := 0 to arr.Count-1 do if fJSON.findArray('sourcePaths', arr) then
for i := 0 to arr.Count-1 do
begin begin
pth := TrimRightSet(arr.Strings[i], ['/','\']); pth := TrimRightSet(arr.Strings[i], ['/','\']);
if pth.dirExists and FilenameIsAbsolute(pth) then if pth.dirExists and FilenameIsAbsolute(pth) then
@ -1344,8 +1346,9 @@ begin
tryAddFromFolder(expandFilenameEx(fBasePath, pth)); tryAddFromFolder(expandFilenameEx(fBasePath, pth));
end; end;
// custom files // custom files
if fJSON.findArray('sourceFiles', arr) then for i := 0 to arr.Count-1 do if fJSON.findArray('sourceFiles', arr) then
tryAddRelOrAbsFile(arr.Strings[i]); for i := 0 to arr.Count-1 do
tryAddRelOrAbsFile(arr.Strings[i]);
conf := getCurrentCustomConfig; conf := getCurrentCustomConfig;
if conf.isNotNil then if conf.isNotNil then
begin begin
@ -1358,7 +1361,8 @@ begin
fSrcs.Add(patchPlateformPath(pth)); fSrcs.Add(patchPlateformPath(pth));
end; end;
// custom folders in current config // custom folders in current config
if conf.findArray('sourcePaths', arr) then for i := 0 to arr.Count-1 do if conf.findArray('sourcePaths', arr) then
for i := 0 to arr.Count-1 do
begin begin
pth := TrimRightSet(arr.Strings[i], ['/','\']); pth := TrimRightSet(arr.Strings[i], ['/','\']);
if pth.dirExists and FilenameIsAbsolute(pth) then if pth.dirExists and FilenameIsAbsolute(pth) then
@ -1367,8 +1371,9 @@ begin
tryAddFromFolder(expandFilenameEx(fBasePath, pth)); tryAddFromFolder(expandFilenameEx(fBasePath, pth));
end; end;
// custom files in current config // custom files in current config
if conf.findArray('sourceFiles', arr) then for i := 0 to arr.Count-1 do if conf.findArray('sourceFiles', arr) then
tryAddRelOrAbsFile(arr.Strings[i]); for i := 0 to arr.Count-1 do
tryAddRelOrAbsFile(arr.Strings[i]);
end; end;
// exclusions : not managed anymore because of other IDE features that rely // exclusions : not managed anymore because of other IDE features that rely
// on the full list (scan TODOs, <CPFS>, search in project, etc) // on the full list (scan TODOs, <CPFS>, search in project, etc)
@ -1467,7 +1472,8 @@ procedure TDubProject.updateImportPathsFromJson;
pth: string; pth: string;
i: integer; i: integer;
begin begin
if obj.findArray('importPaths', arr) then for i := 0 to arr.Count-1 do if obj.findArray('importPaths', arr) then
for i := 0 to arr.Count-1 do
begin begin
pth := TrimRightSet(arr.Strings[i], ['/','\']); pth := TrimRightSet(arr.Strings[i], ['/','\']);
if pth.dirExists and FilenameIsAbsolute(pth) then if pth.dirExists and FilenameIsAbsolute(pth) then

View File

@ -455,11 +455,16 @@ var
prt: TJSONData; prt: TJSONData;
sel: TTreeNode; sel: TTreeNode;
begin begin
if fSelectedNode.isNil then exit; if fSelectedNode.isNil then
if fSelectedNode.Level = 0 then exit; exit;
if fSelectedNode.Text = 'name' then exit; if fSelectedNode.Level = 0 then
if fSelectedNode.Data.isNil then exit; exit;
if fSelectedNode.Parent.Data.isNil then exit; if fSelectedNode.Text = 'name' then
exit;
if fSelectedNode.Data.isNil then
exit;
if fSelectedNode.Parent.Data.isNil then
exit;
fProj.beginModification; fProj.beginModification;
prt := TJSONData(fSelectedNode.Parent.Data); prt := TJSONData(fSelectedNode.Parent.Data);
@ -588,8 +593,8 @@ var
dat: TJSONData; dat: TJSONData;
begin begin
edProp.Clear; edProp.Clear;
if fSelectedNode.isNil then exit; if fSelectedNode.isNil or fSelectedNode.Data.isNil then
if fSelectedNode.Data.isNil then exit; exit;
dat := TJSONData(fSelectedNode.Data); dat := TJSONData(fSelectedNode.Data);
case dat.JSONType of case dat.JSONType of
@ -617,7 +622,8 @@ procedure TDubProjectEditorWidget.updateEditor;
c: TTreeNode; c: TTreeNode;
begin begin
node.Data:= data; node.Data:= data;
if data.JSONType = jtObject then for i := 0 to data.Count-1 do if data.JSONType = jtObject then
for i := 0 to data.Count-1 do
begin begin
node.ImageIndex:=0; node.ImageIndex:=0;
node.SelectedIndex:=0; node.SelectedIndex:=0;
@ -633,7 +639,8 @@ procedure TDubProjectEditorWidget.updateEditor;
c.StateIndex:=2; c.StateIndex:=2;
end; end;
end; end;
end else if data.JSONType = jtArray then for i := 0 to data.Count-1 do end else if data.JSONType = jtArray then
for i := 0 to data.Count-1 do
begin begin
node.ImageIndex:=1; node.ImageIndex:=1;
node.SelectedIndex:=1; node.SelectedIndex:=1;

View File

@ -518,7 +518,8 @@ begin
if fDoc.isNotNil and pageControl.currentPage.isNotNil and if fDoc.isNotNil and pageControl.currentPage.isNotNil and
(pageControl.currentPage.Caption = '<new document>') then (pageControl.currentPage.Caption = '<new document>') then
updatePageCaption(pageControl.currentPage); updatePageCaption(pageControl.currentPage);
if document = fDoc then exit; if document = fDoc then
exit;
fDoc := document; fDoc := document;
fDoc.Visible:=true; fDoc.Visible:=true;
focusedEditorChanged; focusedEditorChanged;
@ -668,8 +669,8 @@ end;
procedure TEditorWidget.focusedEditorChanged; procedure TEditorWidget.focusedEditorChanged;
begin begin
if fDoc.isNil then exit; if fDoc.isNil then
// exit;
macRecorder.Editor:= fDoc; macRecorder.Editor:= fDoc;
fDoc.PopupMenu := mnuEditor; fDoc.PopupMenu := mnuEditor;
fDoc.hideCallTips; fDoc.hideCallTips;
@ -684,14 +685,16 @@ end;
procedure TEditorWidget.PageControlChanged(Sender: TObject); procedure TEditorWidget.PageControlChanged(Sender: TObject);
begin begin
if fDoc.isNil then exit; if fDoc.isNil then
exit;
fDoc.hideCallTips; fDoc.hideCallTips;
fDoc.hideDDocs; fDoc.hideDDocs;
end; end;
procedure TEditorWidget.PageControlChanging(Sender: TObject; var AllowChange: Boolean); procedure TEditorWidget.PageControlChanging(Sender: TObject; var AllowChange: Boolean);
begin begin
if fDoc.isNil then exit; if fDoc.isNil then
exit;
fDoc.hideCallTips; fDoc.hideCallTips;
fDoc.hideDDocs; fDoc.hideDDocs;
end; end;
@ -754,7 +757,8 @@ end;
procedure TEditorWidget.memoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure TEditorWidget.memoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin begin
if not (ssLeft in Shift) then exit; if not (ssLeft in Shift) then
exit;
beginDelayedUpdate; beginDelayedUpdate;
end; end;
@ -770,8 +774,9 @@ var
fname: string; fname: string;
len: byte; len: byte;
begin begin
if not DcdWrapper.available then exit; if not DcdWrapper.available then
// exit;
DcdWrapper.getDeclFromCursor(fname, srcpos); DcdWrapper.getDeclFromCursor(fname, srcpos);
if (fname <> fDoc.fileName) and fname.fileExists then if (fname <> fDoc.fileName) and fname.fileExists then
begin begin
@ -1143,7 +1148,8 @@ end;
procedure TEditorWidget.mnuedDdocClick(Sender: TObject); procedure TEditorWidget.mnuedDdocClick(Sender: TObject);
begin begin
if fDoc.isNil then exit; if fDoc.isNil then
exit;
mnuEditor.Close; mnuEditor.Close;
fDoc.hideCallTips; fDoc.hideCallTips;
if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then if not fDoc.IsDSource and not fDoc.alwaysAdvancedFeatures then

View File

@ -363,36 +363,46 @@ end;
procedure TEditorOptionsBase.setDDocDelay(value: Integer); procedure TEditorOptionsBase.setDDocDelay(value: Integer);
begin begin
if value > 2000 then value := 2000 if value > 2000 then
else if value < 20 then value := 20; value := 2000
else if value < 20 then
value := 20;
fDDocDelay:=value; fDDocDelay:=value;
end; end;
procedure TEditorOptionsBase.setDscannerDelay(value: Integer); procedure TEditorOptionsBase.setDscannerDelay(value: Integer);
begin begin
if value > 10000 then value := 10000 if value > 10000 then
else if value < 500 then value := 500; value := 10000
else if value < 500 then
value := 500;
fDscannerDelay:=value; fDscannerDelay:=value;
end; end;
procedure TEditorOptionsBase.setAutoDotDelay(value: Integer); procedure TEditorOptionsBase.setAutoDotDelay(value: Integer);
begin begin
if value > 2000 then value := 2000 if value > 2000 then
else if value < 0 then value := 0; value := 2000
else if value < 0 then
value := 0;
fAutoDotDelay:=value; fAutoDotDelay:=value;
end; end;
procedure TEditorOptionsBase.setCompletionMenuLines(value: byte); procedure TEditorOptionsBase.setCompletionMenuLines(value: byte);
begin begin
if value < 5 then value := 5 if value < 5 then
else if value > 64 then value := 64; value := 5
else if value > 64 then
value := 64;
fCompletionMenuLines := value; fCompletionMenuLines := value;
end; end;
procedure TEditorOptionsBase.setLineNumEvery(value: integer); procedure TEditorOptionsBase.setLineNumEvery(value: integer);
begin begin
if value < 1 then value := 1 if value < 1 then
else if value > 10 then value := 10; value := 1
else if value > 10 then
value := 10;
fLineNumEvery := value; fLineNumEvery := value;
end; end;
@ -586,7 +596,7 @@ begin
if identifier.length > 2 then if identifier.length > 2 then
identifier := identifier[3..identifier.length]; identifier := identifier[3..identifier.length];
aShortcut := shrct.shortcut; aShortcut := shrct.shortcut;
//
fShortcutCount += 1; fShortcutCount += 1;
result := fShortcutCount < fShortCuts.Count; result := fShortcutCount < fShortCuts.Count;
end; end;
@ -596,8 +606,8 @@ var
i: Integer; i: Integer;
shc: TPersistentShortcut; shc: TPersistentShortcut;
begin begin
if category <> 'Code editor' then exit; if category <> 'Code editor' then
// exit;
for i:= 0 to fShortCuts.Count-1 do for i:= 0 to fShortCuts.Count-1 do
begin begin
shc := TPersistentShortcut(fShortCuts.Items[i]); shc := TPersistentShortcut(fShortCuts.Items[i]);

View File

@ -120,8 +120,9 @@ var
pth: string; pth: string;
cmp: DCompiler; cmp: DCompiler;
begin begin
if fLabel.isNil or fStatus.isNil then exit; if fLabel.isNil or fStatus.isNil then
// exit;
fPresent := false; fPresent := false;
fLabel.Caption:= fToolName; fLabel.Caption:= fToolName;
case fKind of case fKind of

View File

@ -146,7 +146,8 @@ begin
rc := Rect(vRight, ARect.Top, ARect.Right, ARect.Bottom); rc := Rect(vRight, ARect.Top, ARect.Right, ARect.Bottom);
FillChar(Style{%H-},SizeOf(Style),0); FillChar(Style{%H-},SizeOf(Style),0);
With Style do begin With Style do
begin
Alignment := taLeftJustify; Alignment := taLeftJustify;
Layout := tlCenter; Layout := tlCenter;
Opaque := false; Opaque := false;
@ -157,9 +158,11 @@ begin
SystemFont := true; SystemFont := true;
end; end;
If (pedsInComboList in AState) and not (pedsInEdit in AState) If (pedsInComboList in AState) and not (pedsInEdit in AState)
then begin then
begin
OldColor := ACanvas.Brush.Color; OldColor := ACanvas.Brush.Color;
If pedsSelected in AState then begin If pedsSelected in AState then
begin
ACanvas.Brush.Color := clHighlight; ACanvas.Brush.Color := clHighlight;
ACanvas.Font.Color := clHighlightText; ACanvas.Font.Color := clHighlightText;
end end

View File

@ -93,7 +93,8 @@ var
trv: TTreeView; trv: TTreeView;
begin begin
result := ''; result := '';
if src.isNil then exit; if src.isNil then
exit;
// from mini-explorer // from mini-explorer
if src is TShellListView then if src is TShellListView then
begin begin
@ -132,9 +133,11 @@ var
fname: string; fname: string;
fmt: TProjectFileFormat; fmt: TProjectFileFormat;
begin begin
if Source.isNil then exit; if Source.isNil then
exit;
fname := getFilename(Source); fname := getFilename(Source);
if not fname.fileExists then exit; if not fname.fileExists then
exit;
fmt := projectFormat(fname); fmt := projectFormat(fname);
if fmt in [pffDexed, pffDub] then if fmt in [pffDexed, pffDub] then

View File

@ -625,7 +625,8 @@ begin
end; end;
end; end;
// add the library files and the import paths for the selection // add the library files and the import paths for the selection
if not sel.IsEmpty then with sel.Iterator do if not sel.IsEmpty then
with sel.Iterator do
begin begin
while true do while true do
begin begin

View File

@ -151,7 +151,8 @@ end;
procedure TLibManEditorWidget.projChanged(project: ICommonProject); procedure TLibManEditorWidget.projChanged(project: ICommonProject);
begin begin
if fProj = nil then exit; if fProj = nil then
exit;
if fProj <> project then if fProj <> project then
exit; exit;

View File

@ -1325,7 +1325,8 @@ begin
lst.DelimitedText := value; lst.DelimitedText := value;
for value in lst do for value in lst do
begin begin
if value.isEmpty then continue; if value.isEmpty then
continue;
if isEditable(value.extractFileExt) then if isEditable(value.extractFileExt) then
openFile(value) openFile(value)
else if isValidNativeProject(value) or isValidDubProject(value) then else if isValidNativeProject(value) or isValidDubProject(value) then
@ -1802,7 +1803,8 @@ var
begin begin
// project and files MRU // project and files MRU
fname := getDocPath + 'mostrecent.txt'; fname := getDocPath + 'mostrecent.txt';
if fname.fileExists then with TPersistentMainMrus.create(nil) do if fname.fileExists then
with TPersistentMainMrus.create(nil) do
try try
setTargets(fFileMru, fProjMru, fPrjGrpMru); setTargets(fFileMru, fProjMru, fPrjGrpMru);
loadFromFile(fname); loadFromFile(fname);
@ -1811,7 +1813,8 @@ begin
end; end;
// shortcuts for the actions standing in the main action list // shortcuts for the actions standing in the main action list
fname := getDocPath + 'mainshortcuts.txt'; fname := getDocPath + 'mainshortcuts.txt';
if fname.fileExists then with TPersistentMainShortcuts.create(nil) do if fname.fileExists then
with TPersistentMainShortcuts.create(nil) do
try try
loadFromFile(fname); loadFromFile(fname);
assignTo(self); assignTo(self);
@ -1870,11 +1873,13 @@ begin
exit; exit;
DockMaster.RestoreLayouts.Clear; DockMaster.RestoreLayouts.Clear;
if WindowState = wsMinimized then WindowState := wsNormal; if WindowState = wsMinimized then
WindowState := wsNormal;
// does not save minimized/undocked windows to prevent bugs // does not save minimized/undocked windows to prevent bugs
for i:= 0 to fWidgList.Count-1 do for i:= 0 to fWidgList.Count-1 do
begin begin
if not fWidgList.widget[i].isDockable then continue; if not fWidgList.widget[i].isDockable then
continue;
if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
else if not DockMaster.GetAnchorSite(fWidgList.widget[i]).HasParent then else if not DockMaster.GetAnchorSite(fWidgList.widget[i]).HasParent then
@ -2348,7 +2353,8 @@ begin
if trgMnu.isNil then if trgMnu.isNil then
exit; exit;
if fUpdateCount > 0 then exit; if fUpdateCount > 0 then
exit;
Inc(fUpdateCount); Inc(fUpdateCount);
try try
if srcLst = fFileMru then if srcLst = fFileMru then
@ -2951,8 +2957,9 @@ begin
lst := TStringList.Create; lst := TStringList.Create;
try try
proc.getFullLines(lst); proc.getFullLines(lst);
if proc = fRunProc then for str in lst do if proc = fRunProc then
fMsgs.message(str, fDoc, amcEdit, amkBub) for str in lst do
fMsgs.message(str, fDoc, amcEdit, amkBub)
else // dmd used to compile runnable else // dmd used to compile runnable
for str in lst do for str in lst do
fMsgs.message(str, fDoc, amcEdit, amkAuto); fMsgs.message(str, fDoc, amcEdit, amkAuto);
@ -3557,8 +3564,8 @@ begin
dlgOkInfo('Non executable projects cant be run') dlgOkInfo('Non executable projects cant be run')
else else
begin begin
if (not fProject.targetUpToDate) then if if not fProject.targetUpToDate and
dlgYesNo('The project output is not up-to-date, rebuild ?') = mrYes then (dlgYesNo('The project output is not up-to-date, rebuild ?') = mrYes) then
begin begin
if fAppliOpts.autoSaveProjectFiles then if fAppliOpts.autoSaveProjectFiles then
saveModifiedProjectFiles(fProject); saveModifiedProjectFiles(fProject);
@ -3718,7 +3725,7 @@ begin
TForm(widg.Parent).FormStyle := fstyle[onTop]; TForm(widg.Parent).FormStyle := fstyle[onTop];
//TODO-cbugfix: floating widg on top from true to false, widg remains on top //TODO-cbugfix: floating widg on top from true to false, widg remains on top
// OK on linux (LCL 1.6.0), initially observed on win & LCL 1.4.2 // OK on linux (LCL 1.6.0), initially observed on win & LCL 1.4.2
if TForm(widg.Parent).Visible then if not onTop then if TForm(widg.Parent).Visible and not onTop then
TForm(widg.Parent).SendToBack; TForm(widg.Parent).SendToBack;
end; end;
end; end;
@ -3979,10 +3986,11 @@ procedure TMainForm.actProjEditorExecute(Sender: TObject);
var var
win: TControl = nil; win: TControl = nil;
begin begin
if assigned(fProject) then case fProject.getFormat of if assigned(fProject) then
pfDUB: win := DockMaster.GetAnchorSite(fDubProjWidg); case fProject.getFormat of
pfDEXED: win := DockMaster.GetAnchorSite(fPrjCfWidg); pfDUB: win := DockMaster.GetAnchorSite(fDubProjWidg);
end pfDEXED: win := DockMaster.GetAnchorSite(fPrjCfWidg);
end
else win := DockMaster.GetAnchorSite(fPrjCfWidg); else win := DockMaster.GetAnchorSite(fPrjCfWidg);
if win.isNotNil then if win.isNotNil then
begin begin

View File

@ -499,7 +499,8 @@ begin
else clearbyContext(amcAll); else clearbyContext(amcAll);
end; end;
VK_UP, VK_DOWN: VK_UP, VK_DOWN:
if fOptions.singleMessageClick then handleMessageClick(nil); if fOptions.singleMessageClick then
handleMessageClick(nil);
VK_RETURN: VK_RETURN:
handleMessageClick(nil); handleMessageClick(nil);
end; end;
@ -787,7 +788,6 @@ procedure TMessagesWidget.projClosing(project: ICommonProject);
begin begin
if fProj <> project then if fProj <> project then
exit; exit;
//
clearbyData(fProj); clearbyData(fProj);
fProj := nil; fProj := nil;
filterMessages(fCtxt); filterMessages(fCtxt);
@ -795,7 +795,8 @@ end;
procedure TMessagesWidget.projFocused(project: ICommonProject); procedure TMessagesWidget.projFocused(project: ICommonProject);
begin begin
if fProj = project then exit; if fProj = project then
exit;
fProj := project; fProj := project;
filterMessages(fCtxt); filterMessages(fCtxt);
end; end;
@ -833,7 +834,8 @@ end;
procedure TMessagesWidget.docClosing(document: TDexedMemo); procedure TMessagesWidget.docClosing(document: TDexedMemo);
begin begin
if document <> fDoc then exit; if document <> fDoc then
exit;
clearbyData(fDoc); clearbyData(fDoc);
fEditorMessagePos.Remove(fDoc.fileName); fEditorMessagePos.Remove(fDoc.fileName);
fDoc := nil; fDoc := nil;
@ -844,8 +846,8 @@ procedure TMessagesWidget.docFocused(document: TDexedMemo);
var var
i: integer; i: integer;
begin begin
if fDoc = document then exit; if fDoc = document then
exit;
if fDoc.isNotNil and fOptions.fAutoSelect and (fCtxt = amcEdit) then if fDoc.isNotNil and fOptions.fAutoSelect and (fCtxt = amcEdit) then
begin begin
if list.Selected.isNotNil then if list.Selected.isNotNil then
@ -922,7 +924,7 @@ begin
dt := new(PMessageData); dt := new(PMessageData);
dt^.data := aData; dt^.data := aData;
dt^.ctxt := aCtxt; dt^.ctxt := aCtxt;
if fAutoSelect then if fCtxt <> aCtxt then if fAutoSelect and (fCtxt <> aCtxt) then
fBtns[aCtxt].Click; fBtns[aCtxt].Click;
if fastDisplay then if fastDisplay then
IncLoopUpdate; IncLoopUpdate;

View File

@ -184,10 +184,14 @@ var
dt: PCategoryData; dt: PCategoryData;
begin begin
result := true; result := true;
if fUpdatingCat then exit; if fUpdatingCat then
if csDestroying in ComponentState then exit; exit;
if selCat.Selected.isNil then exit; if csDestroying in ComponentState then
if selCat.Selected.Data.isNil then exit; exit;
if selCat.Selected.isNil then
exit;
if selCat.Selected.Data.isNil then
exit;
// accept/cancel is relative to a single category // accept/cancel is relative to a single category
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
// generic editor, changes are tracked directly here // generic editor, changes are tracked directly here
@ -197,18 +201,20 @@ begin
begin begin
result := dlgYesNo(msg_mod) = mrYes; result := dlgYesNo(msg_mod) = mrYes;
fCatChanged := not result; fCatChanged := not result;
if result then btnCancelClick(nil); if result then
btnCancelClick(nil);
end; end;
// custom editor, changes are notified by optionedOptionsModified() // custom editor, changes are notified by optionedOptionsModified()
end else end else
begin begin
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
if dt^.container.isNil then exit; if dt^.container.isNil or (dt^.observer = nil) then
if dt^.observer = nil then exit; exit;
if dt^.observer.optionedOptionsModified() then if dt^.observer.optionedOptionsModified() then
begin begin
result := dlgYesNo(msg_mod) = mrYes; result := dlgYesNo(msg_mod) = mrYes;
if result then btnCancelClick(nil); if result then
btnCancelClick(nil);
end; end;
end; end;
end; end;
@ -230,12 +236,13 @@ begin
pnlEd.Controls[0].Visible:=false; pnlEd.Controls[0].Visible:=false;
pnlEd.Controls[0].Parent := nil; pnlEd.Controls[0].Parent := nil;
end; end;
//
if selCat.Selected.isNil then exit; if selCat.Selected.isNil or selcat.Selected.Data.isNil then
if selCat.Selected.Data.isNil then exit; exit;
//
dt := PCategoryData(selCat.Selected.Data); dt := PCategoryData(selCat.Selected.Data);
if dt^.container.isNil then exit; if dt^.container.isNil then
exit;
case dt^.kind of case dt^.kind of
oekControl: oekControl:
begin begin
@ -261,7 +268,7 @@ begin
inspector.Visible:=true; inspector.Visible:=true;
end; end;
end; end;
//
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
.observer .observer
.optionedEvent(oeeSelectCat); .optionedEvent(oeeSelectCat);
@ -269,9 +276,9 @@ end;
procedure TOptionEditorWidget.inspectorModified(Sender: TObject); procedure TOptionEditorWidget.inspectorModified(Sender: TObject);
begin begin
if selCat.Selected.isNil then exit; if selCat.Selected.isNil or selcat.Selected.Data.isNil then
if selcat.Selected.Data.isNil then exit; exit;
//
fCatChanged := true; fCatChanged := true;
PCategoryData(selCat.Selected.Data)^ PCategoryData(selCat.Selected.Data)^
.observer .observer
@ -280,9 +287,9 @@ end;
procedure TOptionEditorWidget.btnCancelClick(Sender: TObject); procedure TOptionEditorWidget.btnCancelClick(Sender: TObject);
begin begin
if selCat.Selected.isNil then exit; if selCat.Selected.isNil or selcat.Selected.Data.isNil then
if selcat.Selected.Data.isNil then exit; exit;
//
fCatChanged := false; fCatChanged := false;
if inspector.Parent.isNotNil then if inspector.Parent.isNotNil then
inspector.ItemIndex := -1; inspector.ItemIndex := -1;
@ -318,9 +325,9 @@ end;
procedure TOptionEditorWidget.btnAcceptClick(Sender: TObject); procedure TOptionEditorWidget.btnAcceptClick(Sender: TObject);
begin begin
if selCat.Selected.isNil then exit; if selCat.Selected.isNil or selcat.Selected.Data.isNil then
if selcat.Selected.Data.isNil then exit; exit;
//
fCatChanged := false; fCatChanged := false;
if inspector.Parent.isNotNil then if inspector.Parent.isNotNil then
inspector.ItemIndex := -1; inspector.ItemIndex := -1;

View File

@ -272,7 +272,8 @@ begin
begin begin
lastTerm := fStdoutEx.Position; lastTerm := fStdoutEx.Position;
while fStdoutEx.Read(buff, 1) = 1 do while fStdoutEx.Read(buff, 1) = 1 do
if buff = 10 then lastTerm := fStdoutEx.Position; if buff = 10 then
lastTerm := fStdoutEx.Position;
fStdoutEx.Position := stored; fStdoutEx.Position := stored;
if lastTerm <> stored then if lastTerm <> stored then
begin begin
@ -313,7 +314,8 @@ procedure TDexedProcess.internalDoOnTerminate(sender: TObject);
begin begin
fHasRead := false; fHasRead := false;
fTerminateChecker.Enabled := false; fTerminateChecker.Enabled := false;
if fDoneTerminated then exit; if fDoneTerminated then
exit;
fDoneTerminated := true; fDoneTerminated := true;
// restore if same proc is called again, // restore if same proc is called again,

View File

@ -131,7 +131,8 @@ begin
if not (poUsePipes in process.Options) then if not (poUsePipes in process.Options) then
exit; exit;
fProc := process; fProc := process;
if fProc.isNotNil then Panel1.Enabled:=true; if fProc.isNotNil then
Panel1.Enabled:=true;
txtExeName.Caption := shortenPath(fProc.Executable); txtExeName.Caption := shortenPath(fProc.Executable);
end; end;
@ -189,15 +190,18 @@ procedure TProcInputWidget.txtInpKeyDown(Sender: TObject; var Key: Word;
begin begin
case Key of case Key of
VK_RETURN: VK_RETURN:
if fProc.isNotNil then sendInput; if fProc.isNotNil then
sendInput;
VK_UP: begin VK_UP: begin
fMruPos += 1; fMruPos += 1;
if fMruPos > fMru.Count-1 then fMruPos := 0; if fMruPos > fMru.Count-1 then
fMruPos := 0;
txtInp.Text := fMru[fMruPos]; txtInp.Text := fMru[fMruPos];
end; end;
VK_DOWN: begin VK_DOWN: begin
fMruPos -= 1; fMruPos -= 1;
if fMruPos < 0 then fMruPos := fMru.Count-1; if fMruPos < 0 then
fMruPos := fMru.Count-1;
txtInp.Text := fMru[fMruPos]; txtInp.Text := fMru[fMruPos];
end; end;
end; end;

View File

@ -159,7 +159,7 @@ inherited ProjectGroupWidget: TProjectGroupWidget
end end
object button0: TDexedToolButton[5] object button0: TDexedToolButton[5]
Left = 113 Left = 113
Height = 28 Height = 5
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = 'button0' Caption = 'button0'

View File

@ -424,8 +424,9 @@ begin
end end
else if fBasePath = '' then else if fBasePath = '' then
c := true; c := true;
if c then for i:= 0 to projectCount-1 do if c then
getItem(i).fFilename := ExtractRelativepath(n, getItem(i).fFilename); for i:= 0 to projectCount-1 do
getItem(i).fFilename := ExtractRelativepath(n, getItem(i).fFilename);
fBasePath := n; fBasePath := n;
f := ChangeFileExt(f, '.dgrp'); f := ChangeFileExt(f, '.dgrp');
saveToFile(f); saveToFile(f);
@ -666,8 +667,8 @@ procedure TProjectGroupWidget.btnAsyncClick(Sender: TObject);
var var
prj: TProjectGroupItem; prj: TProjectGroupItem;
begin begin
if lstProj.ItemIndex = -1 then exit; if lstProj.ItemIndex = -1 then
// exit;
prj := projectGroup.item[lstProj.ItemIndex]; prj := projectGroup.item[lstProj.ItemIndex];
case prj.asyncMode of case prj.asyncMode of
amSequential: prj.asyncMode := amParallel; amSequential: prj.asyncMode := amParallel;
@ -678,9 +679,8 @@ end;
procedure TProjectGroupWidget.btnMoveDownClick(Sender: TObject); procedure TProjectGroupWidget.btnMoveDownClick(Sender: TObject);
begin begin
if lstProj.ItemIndex = -1 then exit; if (lstProj.ItemIndex = -1) or (lstProj.ItemIndex = lstProj.Items.Count-1) then
if lstProj.ItemIndex = lstProj.Items.Count-1 then exit; exit;
//
projectGroup.items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex + 1); projectGroup.items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex + 1);
lstProj.Items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex + 1); lstProj.Items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex + 1);
projectGroup.index:=projectGroup.index+1; projectGroup.index:=projectGroup.index+1;
@ -689,9 +689,8 @@ end;
procedure TProjectGroupWidget.btnMoveUpClick(Sender: TObject); procedure TProjectGroupWidget.btnMoveUpClick(Sender: TObject);
begin begin
if lstProj.ItemIndex = -1 then exit; if (lstProj.ItemIndex = -1) or (lstProj.ItemIndex = 0) then
if lstProj.ItemIndex = 0 then exit; exit;
//
projectGroup.items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex - 1); projectGroup.items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex - 1);
lstProj.Items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex - 1); lstProj.Items.Exchange(lstProj.ItemIndex, lstProj.ItemIndex - 1);
projectGroup.index:=projectGroup.index-1; projectGroup.index:=projectGroup.index-1;
@ -700,7 +699,8 @@ end;
procedure TProjectGroupWidget.btnRemProjClick(Sender: TObject); procedure TProjectGroupWidget.btnRemProjClick(Sender: TObject);
begin begin
if lstProj.ItemIndex = -1 then exit; if lstProj.ItemIndex = -1 then
exit;
projectGroup.items.Delete(lstProj.Selected.Index); projectGroup.items.Delete(lstProj.Selected.Index);
updateList; updateList;
end; end;

View File

@ -239,7 +239,8 @@ begin
fReplaceMru:= TMruList.Create; fReplaceMru:= TMruList.Create;
fname := getDocPath + OptsFname; fname := getDocPath + OptsFname;
if fname.fileExists then with TSearchOptions.create(nil) do if fname.fileExists then
with TSearchOptions.create(nil) do
try try
loadFromFile(fname); loadFromFile(fname);
assignTo(self); assignTo(self);
@ -304,11 +305,16 @@ end;
function TSearchWidget.getOptions: TSynSearchOptions; function TSearchWidget.getOptions: TSynSearchOptions;
begin begin
result := []; result := [];
if chkRegex.Checked then result += [ssoRegExpr]; if chkRegex.Checked then
if chkWWord.Checked then result += [ssoWholeWord]; result += [ssoRegExpr];
if chkBack.Checked then result += [ssoBackwards]; if chkWWord.Checked then
if chkCaseSens.Checked then result += [ssoMatchCase]; result += [ssoWholeWord];
if chkPrompt.Checked then result += [ssoPrompt]; if chkBack.Checked then
result += [ssoBackwards];
if chkCaseSens.Checked then
result += [ssoMatchCase];
if chkPrompt.Checked then
result += [ssoPrompt];
end; end;
function dlgReplaceAll: TModalResult; function dlgReplaceAll: TModalResult;
@ -530,12 +536,13 @@ begin
fSearchMru.Insert(0, fToFind); fSearchMru.Insert(0, fToFind);
fReplaceMru.Insert(0, fReplaceWth); fReplaceMru.Insert(0, fReplaceWth);
if chkPrompt.Checked then fDoc.OnReplaceText := @replaceEvent; if chkPrompt.Checked then
fDoc.OnReplaceText := @replaceEvent;
fDoc.CaretXY := Point(0,0); fDoc.CaretXY := Point(0,0);
while(true) do while(true) do
begin begin
if fDoc.SearchReplace(fToFind, fReplaceWth, opts) = 0 if fDoc.SearchReplace(fToFind, fReplaceWth, opts) = 0 then
then break; break;
if fCancelAll then if fCancelAll then
begin begin
fCancelAll := false; fCancelAll := false;
@ -589,13 +596,15 @@ end;
procedure TSearchWidget.docClosing(document: TDexedMemo); procedure TSearchWidget.docClosing(document: TDexedMemo);
begin begin
if fDoc = document then fDoc := nil; if fDoc = document then
fDoc := nil;
updateImperative; updateImperative;
end; end;
procedure TSearchWidget.docFocused(document: TDexedMemo); procedure TSearchWidget.docFocused(document: TDexedMemo);
begin begin
if fDoc = document then exit; if fDoc = document then
exit;
fDoc := document; fDoc := document;
updateImperative; updateImperative;
end; end;
@ -608,7 +617,8 @@ end;
{$REGION Misc. -----------------------------------------------------------------} {$REGION Misc. -----------------------------------------------------------------}
procedure TSearchWidget.cbToFindChange(Sender: TObject); procedure TSearchWidget.cbToFindChange(Sender: TObject);
begin begin
if Updating then exit; if Updating then
exit;
fToFind := cbToFind.Text; fToFind := cbToFind.Text;
fHasSearched := false; fHasSearched := false;
updateImperative; updateImperative;
@ -623,13 +633,15 @@ end;
procedure TSearchWidget.chkEnableRepChange(Sender: TObject); procedure TSearchWidget.chkEnableRepChange(Sender: TObject);
begin begin
if Updating then exit; if Updating then
exit;
updateImperative; updateImperative;
end; end;
procedure TSearchWidget.cbReplaceWthChange(Sender: TObject); procedure TSearchWidget.cbReplaceWthChange(Sender: TObject);
begin begin
if Updating then exit; if Updating then
exit;
fReplaceWth := cbReplaceWth.Text; fReplaceWth := cbReplaceWth.Text;
fHasSearched := false; fHasSearched := false;
updateImperative; updateImperative;

View File

@ -584,9 +584,10 @@ begin
fDoc := document; fDoc := document;
if not Visible then if not Visible then
exit; exit;
if fAutoRefresh then
if fAutoRefresh then beginDelayedUpdate beginDelayedUpdate
else if fRefreshOnFocus then callToolProc; else if fRefreshOnFocus then
callToolProc;
end; end;
procedure TSymbolListWidget.docChanged(document: TDexedMemo); procedure TSymbolListWidget.docChanged(document: TDexedMemo);
@ -607,7 +608,8 @@ end;
{$REGION Symbol-tree things ----------------------------------------------------} {$REGION Symbol-tree things ----------------------------------------------------}
procedure TSymbolListWidget.updateDelayed; procedure TSymbolListWidget.updateDelayed;
begin begin
if not fAutoRefresh then exit; if not fAutoRefresh then
exit;
callToolProc; callToolProc;
end; end;
@ -796,7 +798,8 @@ procedure TSymbolListWidget.toolTerminated(sender: TObject);
begin begin
result := nil; result := nil;
if node.isNil then case stype of if node.isNil then
case stype of
_alias : exit(ndAlias); _alias : exit(ndAlias);
_class : exit(ndClass); _class : exit(ndClass);
_enum : exit(ndEnum); _enum : exit(ndEnum);

View File

@ -905,7 +905,8 @@ begin
if fList.Count > 0 then if fList.Count > 0 then
begin begin
delta := fMemo.CaretY - NativeInt(fList.Items[fPos]); delta := fMemo.CaretY - NativeInt(fList.Items[fPos]);
if (delta > -thresh) and (delta < thresh) then exit; if (delta > -thresh) and (delta < thresh) then
exit;
end; end;
fList.Insert(0, Pointer(NativeInt(fMemo.CaretY))); fList.Insert(0, Pointer(NativeInt(fMemo.CaretY)));
{$POP} {$POP}
@ -1882,7 +1883,8 @@ begin
LogicalCaretXY := point(x, LogicalCaretXY.Y); LogicalCaretXY := point(x, LogicalCaretXY.Y);
ExecuteCommand(ecWordLeft, #0, nil); ExecuteCommand(ecWordLeft, #0, nil);
x0 := LogicalCaretXY.X - 1; x0 := LogicalCaretXY.X - 1;
if (x0 > 1) then while true do if (x0 > 1) then
while true do
begin begin
if (x0 > 1) and (str[x0] in ['*', '+']) and (str[x0-1] = '/') then if (x0 > 1) and (str[x0] in ['*', '+']) and (str[x0-1] = '/') then
begin begin
@ -1999,7 +2001,8 @@ begin
p := CaretXY; p := CaretXY;
line := lineText; line := lineText;
if (CaretX = 1) or not (line[LogicalCaretXY.X] in IdentChars) or if (CaretX = 1) or not (line[LogicalCaretXY.X] in IdentChars) or
not (line[LogicalCaretXY.X-1] in IdentChars) then exit; not (line[LogicalCaretXY.X-1] in IdentChars) then
exit;
old := GetWordAtRowCol(LogicalCaretXY); old := GetWordAtRowCol(LogicalCaretXY);
DcdWrapper.getLocalSymbolUsageFromCursor(locs); DcdWrapper.getLocalSymbolUsageFromCursor(locs);
if length(locs) = 0 then if length(locs) = 0 then
@ -2660,7 +2663,8 @@ begin
str := LineText[1..CaretX]; str := LineText[1..CaretX];
x := CaretX; x := CaretX;
i := min(x, str.length); i := min(x, str.length);
if findOpenParen then while true do if findOpenParen then
while true do
begin begin
if i = 1 then if i = 1 then
break; break;
@ -3578,10 +3582,13 @@ begin
hideDDocs; hideDDocs;
end; end;
end; end;
if not (Shift = [ssCtrl]) then exit; if not (Shift = [ssCtrl]) then
exit;
case Key of case Key of
VK_ADD: if Font.Size < 50 then Font.Size := Font.Size + 1; VK_ADD: if Font.Size < 50 then
VK_SUBTRACT: if Font.Size > 3 then Font.Size := Font.Size - 1; Font.Size := Font.Size + 1;
VK_SUBTRACT: if Font.Size > 3 then
Font.Size := Font.Size - 1;
VK_DECIMAL: Font.Size := fDefaultFontSize; VK_DECIMAL: Font.Size := fDefaultFontSize;
end; end;
fCanShowHint:=false; fCanShowHint:=false;
@ -3640,7 +3647,8 @@ begin
'[': if autoCloseSquareBracket in fAutoClosedPairs then '[': if autoCloseSquareBracket in fAutoClosedPairs then
autoClosePair(autoCloseSquareBracket); autoClosePair(autoCloseSquareBracket);
'(': showCallTips(false); '(': showCallTips(false);
')': if fCallTipWin.Visible then decCallTipsLvl; ')': if fCallTipWin.Visible then
decCallTipsLvl;
'{': if (fAutoCloseCurlyBrace = autoCloseLexically) and '{': if (fAutoCloseCurlyBrace = autoCloseLexically) and
(GetKeyShiftState <> [ssShift]) then (GetKeyShiftState <> [ssShift]) then
begin begin
@ -3673,9 +3681,9 @@ begin
dx := X - fOldMousePos.x; dx := X - fOldMousePos.x;
dy := Y - fOldMousePos.y; dy := Y - fOldMousePos.y;
fCanShowHint:=false; fCanShowHint:=false;
if (shift = []) then if if (shift = []) and
((dx < 0) and (dx > -5) or (dx > 0) and (dx < 5)) or (((dx < 0) and (dx > -5) or (dx > 0) and (dx < 5)) or
((dy < 0) and (dy > -5) or (dy > 0) and (dy < 5)) then ((dy < 0) and (dy > -5) or (dy > 0) and (dy < 5))) then
fCanShowHint:=true; fCanShowHint:=true;
fOldMousePos := Point(X, Y); fOldMousePos := Point(X, Y);
fMousePos := PixelsToRowColumn(fOldMousePos); fMousePos := PixelsToRowColumn(fOldMousePos);

View File

@ -431,8 +431,10 @@ begin
ctxt := getContext; ctxt := getContext;
case ctxt of case ctxt of
tcNone: exit; tcNone: exit;
tcProject: if (fProj = nil) or (fProj.sourcesCount = 0) then exit; tcProject: if (fProj = nil) or (fProj.sourcesCount = 0) then
tcFile: if fDoc = nil then exit; exit;
tcFile: if fDoc = nil then
exit;
end; end;
fToolProc := TDexedProcess.Create(nil); fToolProc := TDexedProcess.Create(nil);

View File

@ -361,7 +361,7 @@ begin
category := 'Tools'; category := 'Tools';
identifier:= tool[fShctCount].toolAlias; identifier:= tool[fShctCount].toolAlias;
aShortcut := tool[fShctCount].shortcut; aShortcut := tool[fShctCount].shortcut;
//
fShctCount += 1; fShctCount += 1;
result := fShctCount < fTools.Count; result := fShctCount < fTools.Count;
end; end;
@ -370,8 +370,8 @@ procedure TTools.scedSendItem(const category, identifier: string; aShortcut: TSh
var var
i: Integer; i: Integer;
begin begin
if category <> 'Tools' then exit; if category <> 'Tools' then
// exit;
for i := 0 to tools.Count-1 do if tool[i].toolAlias = identifier then for i := 0 to tools.Count-1 do if tool[i].toolAlias = identifier then
begin begin
tool[i].shortcut := aShortcut; tool[i].shortcut := aShortcut;
@ -401,7 +401,8 @@ end;
procedure TTools.docClosing(document: TDexedMemo); procedure TTools.docClosing(document: TDexedMemo);
begin begin
if fDoc <> document then exit; if fDoc <> document then
exit;
fDoc := nil; fDoc := nil;
end; end;
{$ENDREGION} {$ENDREGION}
@ -426,8 +427,8 @@ procedure TTools.executeTool(tool: TToolItem);
var var
txt: string = ''; txt: string = '';
begin begin
if tool.isNil then exit; if tool.isNil then
// exit;
tool.execute(nil); tool.execute(nil);
if (tool.pipeInputKind <> pikNone) and fDoc.isNotNil if (tool.pipeInputKind <> pikNone) and fDoc.isNotNil
and (poUsePipes in tool.options) and tool.fProcess.Input.isNotNil then and (poUsePipes in tool.options) and tool.fProcess.Input.isNotNil then
@ -445,9 +446,8 @@ end;
procedure TTools.executeTool(index: Integer); procedure TTools.executeTool(index: Integer);
begin begin
if index < 0 then exit; if (index < 0) or (index > fTools.Count-1) then
if index > fTools.Count-1 then exit; exit;
//
executeTool(tool[index]); executeTool(tool[index]);
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -9,6 +9,7 @@ object DexedWidget: TDexedWidget
ClientWidth = 332 ClientWidth = 332
ShowHint = True ShowHint = True
ShowInTaskBar = stNever ShowInTaskBar = stNever
LCLVersion = '2.0.0.3'
object Back: TPanel object Back: TPanel
Left = 0 Left = 0
Height = 121 Height = 121

View File

@ -205,7 +205,9 @@ begin
end end
else else
begin begin
if isModal then ShowModal else if isModal then
ShowModal
else
begin begin
Show; Show;
BringToFront; BringToFront;
@ -271,8 +273,10 @@ end;
{$REGION Updaters---------------------------------------------------------------} {$REGION Updaters---------------------------------------------------------------}
procedure TDexedWidget.setDelayDur(value: Integer); procedure TDexedWidget.setDelayDur(value: Integer);
begin begin
if value < 100 then value := 100; if value < 100 then
if fDelayDur = value then exit; value := 100;
if fDelayDur = value then
exit;
fDelayDur := value; fDelayDur := value;
fUpdaterDelay.Interval := fDelayDur; fUpdaterDelay.Interval := fDelayDur;
end; end;
@ -304,7 +308,8 @@ end;
procedure TDexedWidget.endImperativeUpdate; procedure TDexedWidget.endImperativeUpdate;
begin begin
Dec(fImperativeUpdateCount); Dec(fImperativeUpdateCount);
if fImperativeUpdateCount > 0 then exit; if fImperativeUpdateCount > 0 then
exit;
fUpdating := true; fUpdating := true;
updateImperative; updateImperative;
fUpdating := false; fUpdating := false;