Compare commits

..

No commits in common. "master" and "v3.9.26" have entirely different histories.

29 changed files with 211 additions and 1110 deletions

View File

@ -1,17 +1,3 @@
# v3.9.27-devel
## Enhancements
- Added the _Git Blame_ widget.
- Search & Replace, add visual feedback in the editor.
## Bugs fixed
- Mini-explorer, clearing the filter had for effect to scan the root folder instead of the selected one. (#129)
- Mini-explorer, on startup selected folder becomes the root, instead of the previous root. (#130)
- With dark themes warning message on exit was barely legible.
- Editor, completions, better behavior with `..` and when "auto-dot" is enabled (_autoDotDelay_ > 0).
# v3.9.26
## Enhancements

View File

@ -26,6 +26,7 @@ Dexed, the _D Extended EDitor_, is an IDE for the [D programming language](https
- :bookmark: latest release: version 3.9.26, Mon 18 Sep. 2023.
- :scroll: licensed under the terms of the Boost software license.
- :dollar: Development can be supported with [Paypal donations](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AQDJVC39PJF7J).
## Download version 3.9.26
@ -34,6 +35,12 @@ Dexed, the _D Extended EDitor_, is an IDE for the [D programming language](https
- :package: [rpm for Linux 64 bit](https://gitlab.com/basile.b/dexed/-/releases/v3.9.26/downloads/binaries/dexed-3.9.26-0.x86_64.rpm)
- :package: [deb for Linux 64 bit](https://gitlab.com/basile.b/dexed/-/releases/v3.9.26/downloads/binaries/dexed-3.9.26.amd64.deb)
The _zip_ archives allow to move freely the files.
The _setup.zip_ archives contain a command line program that installs to predefined locations so that the software can be run without additional intervention.
The _deb_ and the _rpm_ packages are for those who prefer the official setup system of their linux systems.
FreeBSD (all archs), Linux (32 bit) and Windows (32 bits) versions must be [built manually](https://basile.b.gitlab.io/dexed/build.html).
A Windows 64bit build can be found [on appveyor](https://ci.appveyor.com/project/BBasile/dexed/history). Click the top most item that has a green left margin and download the file listed in the "Artifacts" tab.
[**See this page**](https://basile.b.gitlab.io/dexed/setup.html) for more information about the setup.
## Building

View File

@ -125,4 +125,3 @@ __gshared
__traits
__vector
__parameters
__rvalue

View File

@ -7,7 +7,6 @@ break
class
const
continue
defer
delete
do
echo
@ -45,7 +44,6 @@ version
with
while
char
bool
f32
f64

View File

@ -434,7 +434,6 @@
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2"/>
<UseHeaptrc Value="True"/>
</Debugging>
<Options>
@ -488,7 +487,6 @@
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2"/>
<UseHeaptrc Value="True"/>
</Debugging>
<Options>
@ -513,7 +511,7 @@
<RunParams>
<environment>
<UserOverrides Count="1">
<Variable0 Name="LD_LIBRARY_PATH" Value="$(ProjPath)/../bin"/>
<Variable0 Name="LD_LIBRARY_PATH" Value="./"/>
</UserOverrides>
</environment>
<FormatVersion Value="2"/>
@ -521,7 +519,7 @@
<Mode0 Name="default">
<environment>
<UserOverrides Count="1">
<Variable0 Name="LD_LIBRARY_PATH" Value="$(ProjPath)/../bin"/>
<Variable0 Name="LD_LIBRARY_PATH" Value="./"/>
</UserOverrides>
</environment>
</Mode0>
@ -553,7 +551,7 @@
<PackageName Value="LCL"/>
</Item8>
</RequiredPackages>
<Units Count="65">
<Units Count="64">
<Unit0>
<Filename Value="dexed.lpr"/>
<IsPartOfProject Value="True"/>
@ -886,13 +884,6 @@
<Filename Value="..\src\u_makeproject.pas"/>
<IsPartOfProject Value="True"/>
</Unit63>
<Unit64>
<Filename Value="..\src\u_blame.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="BlameWidget"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit64>
</Units>
</ProjectOptions>
<CompilerOptions>
@ -916,7 +907,6 @@
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<DebugInfoType Value="dsDwarf2"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>

View File

@ -14,7 +14,7 @@ uses
u_lcldragdrop, u_stringrange, u_dlangmaps, u_projgroup, u_projutils,
u_d2synpresets, u_dbgitf, u_ddemangle, u_dubproject, LCLVersion,
u_halstead, u_diff, u_profileviewer, u_semver, u_term, u_simpleget,
u_makeproject, u_blame;
u_makeproject;
{$if lcl_fullversion < 2020000}
{$ERROR Lazarus version >= 2.2 required}

View File

@ -1,241 +0,0 @@
inherited BlameWidget: TBlameWidget
Left = 1275
Height = 282
Top = 652
Width = 563
Caption = 'GIT Blame'
ClientHeight = 282
ClientWidth = 563
inherited Content: TPanel
Height = 246
Top = 36
Width = 563
ClientHeight = 246
ClientWidth = 563
object btnBlame: TButton[0]
Left = 8
Height = 32
Top = 206
Width = 547
Align = alClient
BorderSpacing.Around = 8
Caption = 'Blame'
TabOrder = 0
OnClick = btnBlameClick
end
object grpGen: TGroupBox[1]
Left = 4
Height = 95
Top = 4
Width = 555
Align = alTop
AutoSize = True
BorderSpacing.Around = 4
Caption = 'General'
ClientHeight = 76
ClientWidth = 553
TabOrder = 1
object Panel1: TPanel
Left = 4
Height = 32
Top = 4
Width = 545
Align = alTop
BorderSpacing.Around = 4
BevelColor = clNone
BevelOuter = bvNone
ClientHeight = 32
ClientWidth = 545
TabOrder = 0
object Label1: TLabel
Left = 4
Height = 24
Top = 4
Width = 118
Align = alLeft
Alignment = taCenter
BorderSpacing.Around = 4
Caption = 'Displayed Revision '
end
object lblDispRev: TStaticText
Left = 126
Height = 24
Top = 4
Width = 365
Align = alClient
AutoSize = True
BorderSpacing.Around = 4
BorderStyle = sbsSingle
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
end
object btnCpyCurrHash: TSpeedButton
Left = 495
Height = 32
Hint = 'copy current commit hash'
Top = 0
Width = 25
Align = alRight
OnClick = btnCpyCurrHashClick
end
object btnLogCurr: TSpeedButton
Left = 520
Height = 32
Hint = 'show current commit message'
Top = 0
Width = 25
Align = alRight
OnClick = btnLogCurrClick
end
end
object Panel4: TPanel
Left = 4
Height = 32
Top = 40
Width = 545
Align = alTop
BorderSpacing.Around = 4
BevelColor = clNone
BevelOuter = bvNone
ClientHeight = 32
ClientWidth = 545
TabOrder = 1
object Label4: TLabel
Left = 4
Height = 24
Top = 4
Width = 60
Align = alLeft
Alignment = taCenter
BorderSpacing.Around = 4
Caption = 'Filename '
end
object lblFname: TStaticText
Left = 68
Height = 24
Top = 4
Width = 473
Align = alClient
AutoSize = True
BorderSpacing.Around = 4
BorderStyle = sbsSingle
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
end
end
end
object grpLine: TGroupBox[2]
Left = 4
Height = 95
Top = 103
Width = 555
Align = alTop
AutoSize = True
BorderSpacing.Around = 4
Caption = 'Current line'
ClientHeight = 76
ClientWidth = 553
TabOrder = 2
object Panel2: TPanel
Left = 4
Height = 32
Top = 4
Width = 545
Align = alTop
BorderSpacing.Around = 4
BevelColor = clNone
BevelOuter = bvNone
ClientHeight = 32
ClientWidth = 545
TabOrder = 0
object Label2: TLabel
Left = 4
Height = 24
Top = 4
Width = 111
Align = alLeft
Alignment = taCenter
BorderSpacing.Around = 4
Caption = 'Previous Revision '
end
object lblPrevRev: TStaticText
Left = 119
Height = 24
Top = 4
Width = 372
Align = alClient
AutoSize = True
BorderSpacing.Around = 4
BorderStyle = sbsSingle
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
end
object btnCpyPrevHash: TSpeedButton
Left = 495
Height = 32
Hint = 'copy prior commit hash'
Top = 0
Width = 25
Align = alRight
OnClick = btnCpyPrevHashClick
end
object btnLogPrev: TSpeedButton
Left = 520
Height = 32
Hint = 'show prior commit message'
Top = 0
Width = 25
Align = alRight
OnClick = btnLogPrevClick
end
end
object Panel3: TPanel
Left = 4
Height = 32
Top = 40
Width = 545
Align = alTop
BorderSpacing.Around = 4
BevelColor = clNone
BevelOuter = bvNone
ClientHeight = 32
ClientWidth = 545
TabOrder = 1
object Label3: TLabel
Left = 4
Height = 24
Top = 4
Width = 106
Align = alLeft
Alignment = taCenter
BorderSpacing.Around = 4
Caption = 'Author and Date '
end
object lblAuthDate: TStaticText
Left = 114
Height = 24
Top = 4
Width = 427
Align = alClient
AutoSize = True
BorderSpacing.Around = 4
BorderStyle = sbsSingle
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
end
end
end
end
inherited toolbar: TDexedToolBar
Width = 555
end
object Timer1: TTimer[3]
Enabled = False
OnTimer = Timer1Timer
Left = 32
end
end

View File

@ -1,504 +0,0 @@
unit u_blame;
{$I u_defines.inc}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
Buttons, ghashmap, process, Clipbrd,
u_common, u_interfaces, u_observer, u_widget,
u_synmemo, u_stringrange, u_sharedres;
type
TLineData = record
// the previous git hash
hash: string;
// if file has ever moved
filename: string;
// data, author or prev
info: string;
end;
TBlameDataKind = (
bdkNone, // no yet computed
bdkFirst, // initial blame on HEAD
bdkBlame // display in a dedicated editor
);
TEditorData = class
private
// if this is a standard editor or one opened to start blaming
kind: TBlameDataKind;
// the filename in git
filename: string;
// current revision
currHash: string;
// previous revision and fname for each line
lineData: array of TLineData;
end;
TEditorToData = specialize THashmap<TDexedMemo, TEditorData, TObjectHash>;
{ TBlameWidget }
TBlameWidget = class(TDexedWidget, IDocumentObserver, IProjectObserver)
btnBlame: TButton;
btnCpyPrevHash: TSpeedButton;
btnLogCurr: TSpeedButton;
btnLogPrev: TSpeedButton;
grpGen: TGroupBox;
Panel4: TPanel;
grpLine: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Panel1: TPanel;
Label4: TLabel;
lblFname: TStaticText;
Panel2: TPanel;
Panel3: TPanel;
lblDispRev: TStaticText;
lblPrevRev: TStaticText;
lblAuthDate: TStaticText;
btnCpyCurrHash: TSpeedButton;
Timer1: TTimer;
procedure btnBlameClick(Sender: TObject);
procedure btnCpyCurrHashClick(Sender: TObject);
procedure btnCpyPrevHashClick(Sender: TObject);
procedure btnLogCurrClick(Sender: TObject);
procedure btnLogPrevClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
fEditors: TEditorToData;
fDocData: TEditorData;
fDoc: TDExedMemo;
fProj: ICommonProject;
function getGitCwd(): string;
procedure showLog(const hash: string);
function checkTool(var exename: string): boolean;
protected
procedure setVisible(Value: Boolean); override;
procedure setToolBarFlat(value: boolean); override;
public
constructor create(aOwner: TComponent); override;
destructor destroy(); override;
procedure docNew(document: TDexedMemo);
procedure docFocused(document: TDexedMemo);
procedure docChanged(document: TDexedMemo);
procedure docClosing(document: TDexedMemo);
procedure projNew(project: ICommonProject);
procedure projChanged(project: ICommonProject);
procedure projClosing(project: ICommonProject);
procedure projFocused(project: ICommonProject);
procedure projCompiling(project: ICommonProject);
procedure projCompiled(project: ICommonProject; success: boolean);
procedure updateView();
procedure blameToData(gitLines: TStrings; blameLines: TStrings);
procedure blameBegin();
procedure blameContinue();
end;
implementation
{$R *.lfm}
constructor TBlameWidget.create(aOwner: TComponent);
begin
inherited;
fEditors := TEditorToData.create();
toolbarVisible:= false;
case GetIconScaledSize of
iss16:
begin
AssignPng(btnCpyCurrHash, 'COPY');
AssignPng(btnCpyPrevHash, 'COPY');
AssignPng(btnLogCurr, 'GIT');
AssignPng(btnLogPrev, 'GIT');
end;
iss24:
begin
AssignPng(btnCpyCurrHash, 'COPY24');
AssignPng(btnCpyPrevHash, 'COPY24');
AssignPng(btnLogCurr, 'GIT24');
AssignPng(btnLogPrev, 'GIT24');
end;
iss32:
begin
AssignPng(btnCpyCurrHash, 'COPY32');
AssignPng(btnCpyPrevHash, 'COPY32');
AssignPng(btnLogCurr, 'GIT32');
AssignPng(btnLogPrev, 'GIT32');
end;
end;
EntitiesConnector.addObserver(self);
end;
destructor TBlameWidget.destroy();
begin
fEditors.free();
inherited;
end;
procedure TBlameWidget.setVisible(Value: Boolean);
begin
inherited SetVisible(value);
if Timer1.isAssigned then
Timer1.Enabled := value;
end;
procedure TBlameWidget.setToolBarFlat(value: boolean);
begin
inherited;
btnLogCurr.Flat := value;
btnCpyCurrHash.Flat := value;
btnLogPrev.Flat := value;
btnCpyPrevHash.Flat := value;
end;
procedure TBlameWidget.docNew(document: TDexedMemo);
begin
end;
procedure TBlameWidget.docFocused(document: TDexedMemo);
begin
fDoc := document;
if fEditors.contains(document) then
begin
fDocData := fEditors[document];
end else
begin
fDocData := TEditorData.Create;
fEditors.insert(fDoc, fDocData);
end;
end;
procedure TBlameWidget.docChanged(document: TDexedMemo);
begin
end;
procedure TBlameWidget.docClosing(document: TDexedMemo);
var
closingData: TEditorData = nil;
begin
if fEditors.contains(document) then
begin
closingData := fEditors[document];
closingData.Free();
fEditors.delete(document);
end;
if fDoc = document then
fDoc := nil;
end;
procedure TBlameWidget.projNew(project: ICommonProject);
begin
end;
procedure TBlameWidget.projChanged(project: ICommonProject);
begin
end;
procedure TBlameWidget.projClosing(project: ICommonProject);
begin
if project = fProj then
fProj := nil;
end;
procedure TBlameWidget.projFocused(project: ICommonProject);
begin
fProj := project;
end;
procedure TBlameWidget.projCompiling(project: ICommonProject);
begin
end;
procedure TBlameWidget.projCompiled(project: ICommonProject; success: boolean);
begin
end;
procedure TBlameWidget.blameToData(gitLines: TStrings; blameLines: TStrings);
var
i : integer;
line: string;
rng : TStringRange = (ptr:nil; pos:0; len:0);
tmp : string;
begin
setLength(fDocData.lineData, gitLines.Count);
for i := 0 to gitLines.count-1 do
begin
line:= gitLines[i];
rng := TStringRange.create(line);
// hash
tmp := rng.takeUntil(' ').yield().ToLower();
fDocData.lineData[i].hash := tmp;
rng.popFront();
// optional filename
if rng.front() <> '(' then
begin
tmp := rng.takeUntil('(').yield();
tmp := TrimRight(tmp);
fDocData.lineData[i].filename := tmp;
rng.popFront();
end;
// date, author
tmp := rng.takeUntil(')').yield();
fDocData.lineData[i].info := tmp;
rng.popFront;
rng.popFront;
// code
if blameLines.isAssigned() then
begin
tmp := rng.takeUntil([#13,#10]).yield();
blameLines.Add(tmp);
end;
end;
end;
function TBlameWidget.getGitCwd():string;
var
old: string = '';
begin
result := '';
if assigned(fProj) then
begin
result := fProj.filename.extractFileDir;
end
else
if fDoc.isAssigned then
begin
result := fDoc.fileName;
while true do
begin
result := result.extractFileDir;
if result = old then
exit;
if (result + DirectorySeparator + '.git').dirExists then
exit;
old := result;
end;
end;
end;
function TBlameWidget.checkTool(var exename: string): boolean;
begin
exename := exeFullName('git' + exeExt);
result := exename.fileExists();
if not result then
getMessageDisplay().message('cannot locate the `git` executable', nil, amcApp, amkErr);
end;
procedure TBlameWidget.blameBegin();
var
p: TProcess = nil;
s: TStringList = nil;
d: IMessagesDisplay = nil;
i: integer;
g: string = '';
begin
if fDoc.isNotAssigned or not checkTool(g) then
exit;
p := TProcess.create(nil);
s := TStringList.Create();
try
p.Executable:= g;
p.Options := [poUsePipes, poNoConsole];
p.ShowWindow:= swoHIDE;
p.CurrentDirectory:= getGitCwd();
p.Parameters.AddStrings([ 'blame', fDoc.fileName]);
p.execute();
processOutputToStrings(p,s);
while p.Running do ;
if p.ExitCode = 0 then
begin
fDocData.filename := fDoc.fileName;
blameToData(s,nil);
fDocData.kind := bdkFirst;
end else
begin
d := getMessageDisplay();
s.LoadFromStream(p.Stderr);
for i := 0 to s.Count-1 do
d.message(s[i], fProj, amcMisc, amkAuto);
end;
finally
p.free();
s.free();
end;
end;
procedure TBlameWidget.blameContinue();
var
newDoc: TDexedMemo = nil;
oldDoc: TDexedMemo = nil;
p: TProcess = nil;
s: TStringList = nil;
d: TLineData;
m: IMessagesDisplay = nil;
n: string = '';
h: string;
i: integer;
g: string = '';
begin
if fDoc.isNotAssigned or not checkTool(g) then
exit;
oldDoc := fDoc;
d := fDocData.lineData[fDoc.CaretY-1];
h := d.hash;
if d.filename.isNotEmpty then
n := d.filename
else if fDocData.kind = bdkFirst then
n := fDoc.fileName
else
n := fDocData.filename;
p := TProcess.create(nil);
s := TStringList.Create();
try
p.Executable := exeFullName('git' + exeExt);
p.Options := [poUsePipes, poNoConsole];
p.ShowWindow := swoHIDE;
p.CurrentDirectory:= getGitCwd();
p.Parameters.AddStrings([ 'blame', n, h]);
p.execute();
processOutputToStrings(p,s);
while p.Running do ;
if p.ExitCode = 0 then
begin
newDoc := TDexedMemo.Create(nil);
blameToData(s,newDoc.Lines);
fDocData.kind := bdkBlame;
fDocData.currHash := h;
fDocData.filename := n;
newDoc.ReadOnly := true;
newDoc.setHighligtherFrom(oldDoc);
getMultiDocHandler().forceCaption(newDoc, '<blame-only view>');
end else
begin
m := getMessageDisplay();
s.LoadFromStream(p.Stderr);
for i := 0 to s.Count-1 do
m.message(s[i], fProj, amcMisc, amkAuto);
end;
finally
p.free();
s.free();
end;
end;
procedure TBlameWidget.updateView();
var
d: TLineData;
begin
if fDocData.isNotAssigned or (not visible) or fDoc.isNotAssigned then
exit;
if fDocData.kind = bdkNone then
begin
lblFname.Caption := fDoc.fileName;
lblDispRev.Caption := 'HEAD';
lblPrevRev.Caption := 'N/A';
lblAuthDate.Caption:= 'N/A';
btnBlame.Caption := 'Collect initial data';
end else
begin
if fDocData.kind = bdkFirst then
begin
lblFname.Caption := fDoc.fileName;
lblDispRev.Caption:= 'HEAD';
end else
begin
lblFname.Caption := fDocData.fileName;
lblDispRev.Caption:= fDocData.currHash;
end;
d := fDocData.lineData[fDoc.CaretY-1];
lblAuthDate.Caption := d.info;
if d.hash <> fDocData.currHash then
begin
btnBlame.Enabled := true;
btnBlame.Caption := format('Open blame view for %s', [d.hash]);
lblPrevRev.Caption := d.hash;
end else
begin
btnBlame.Enabled := false;
btnBlame.Caption := 'Open blame';
lblPrevRev.Caption := 'N/A (initial commit)';
end;
end;
end;
procedure TBlameWidget.btnBlameClick(Sender: TObject);
begin
if fDocData.isNotAssigned then
exit;
if fDocData.kind = bdkNone then
blameBegin()
else
blameContinue();
end;
procedure TBlameWidget.btnCpyCurrHashClick(Sender: TObject);
begin
if fDocData.isAssigned then
Clipboard.AsText := fDocData.currHash;
end;
procedure TBlameWidget.btnCpyPrevHashClick(Sender: TObject);
begin
if fDocData.isAssigned and (length(fDocData.lineData) <> 0) and fDoc.isAssigned then
Clipboard.AsText := fDocData.lineData[fDoc.CaretY-1].hash;
end;
procedure TBlameWidget.btnLogCurrClick(Sender: TObject);
begin
if fDocData.isAssigned then
showLog(fDocData.currHash);
end;
procedure TBlameWidget.btnLogPrevClick(Sender: TObject);
begin
if fDocData.isAssigned and (length(fDocData.lineData) <> 0) and fDoc.isAssigned then
showLog(fDocData.lineData[fDoc.CaretY-1].hash);
end;
procedure TBlameWidget.showLog(const hash: string);
var
p: TProcess;
g: TStringList;
n: string = '';
begin
if not checkTool(n) or hash.isEmpty() or (hash = 'HEAD') then
exit;
p := TProcess.Create(nil);
g := TStringList.Create;
try
p.Executable := n;
p.Options := [poUsePipes, poNoConsole];
p.ShowWindow := swoHIDE;
p.CurrentDirectory:= getGitCwd();
p.Parameters.AddStrings([ 'log', hash, '-n1', '--pretty=full']);
p.execute();
processOutputToStrings(p,g);
while p.Running do ;
if p.ExitCode = 0 then
begin
showMessage(g.Text);
end;
finally
p.free;
g.free;
end;
end;
procedure TBlameWidget.Timer1Timer(Sender: TObject);
begin
updateView;
end;
end.

View File

@ -351,9 +351,6 @@ type
// Converts the delta between two calls to GetTickCount64 to a string indicating a duration.
function formatTicksAsDuration(ticks: UInt64): string;
// Returns wether runing in a dark DE
function isDarkDE(): boolean;
(**
* Compares two TPoints.
*)
@ -1565,11 +1562,6 @@ begin
result += value[p .. value.length];
end;
function isDarkDE(): boolean;
begin
result := clBackground < clCaptionText;
end;
{$IFDEF DEBUG}
initialization

View File

@ -22,12 +22,9 @@ type
private
function getIndex: integer;
protected
fFixedCaption: string;
procedure realSetText(const Value: TCaption); override;
procedure setFixedCaption(const value: string);
public
property index: integer read getIndex;
property fixedCaption: string read fFixedCaption write setFixedCaption;
end;
TPageControlOption = (poPageHistory, poBottomHeader, poFlatButtons);
@ -174,26 +171,16 @@ procedure TDexedPage.RealSetText(const Value: TCaption);
var
i: integer;
ctrl: TDexedPageControl;
v : string;
begin
v := value;
if fFixedCaption.isNotEmpty then
v := fFixedCaption;
inherited RealSetText(v);
inherited;
ctrl := TDexedPageControl(owner);
i := ctrl.getPageIndex(self);
ctrl.fTabs.BeginUpdate;
if i <> -1 then
ctrl.fTabs.Tabs[i] := v;
ctrl.fTabs.Tabs[i] := value;
ctrl.fTabs.EndUpdate;
end;
procedure TDexedPage.setFixedCaption(const value: string);
begin
fFixedCaption:= value;
caption := value;
end;
constructor TDexedPageControl.Create(aowner: TComponent);
begin
inherited;

View File

@ -648,7 +648,7 @@ begin
// double quoted strings | raw double quoted strings
if (fCurrRange.notInExclusiveRange()) and readDelim(reader, fTokStop, stringPrefixes) then
begin
if readerPrev^ in ['r','x','i'] then
if readerPrev^ in ['r','x'] then
begin
fCurrRange.rString := reader^ = 'r';
if not (readerNext^ = '"') then
@ -747,7 +747,7 @@ begin
end;
// token string
if readDelim(reader, fTokStop, 'q{') or readDelim(reader, fTokStop, 'iq{') then
if readDelim(reader, fTokStop, 'q{') then
begin
fTokKind := tkSymbl;
StartCodeFoldBlock(nil, fkBrackets in fFoldKinds);

View File

@ -38,6 +38,7 @@ type
fProj: ICommonProject;
fPortAsProcParam: string;
fVersion: TSemVer;
fCanRemove: boolean;
procedure killServer;
procedure terminateClient; {$IFNDEF DEBUG}inline;{$ENDIF}
procedure waitClient; {$IFNDEF DEBUG}inline;{$ENDIF}
@ -100,10 +101,11 @@ constructor TDcdWrapper.create(aOwner: TComponent);
var
fname: string;
i: integer = 0;
r: TSemVer;
begin
inherited;
fVersion.init('v0.0.0', false);
fVersion.init('v0.0.0');
fname := getDocPath + optsname;
if fname.fileExists then
loadFromFile(fname);
@ -135,6 +137,16 @@ begin
fTempLines := TStringList.Create;
fImportCache := TStringHashSet.Create;
fClient.Parameters.Add('--version');
fClient.Execute;
processOutputToStrings(fClient, fTempLines);
while fClient.Running do ;
fVersion.init(fTempLines.strictText);
r.major := 0;
r.minor := 9;
r.patch := 10;
fCanRemove := fVersion > r;
if fServer.isAssigned then
begin
fServer.Execute;
@ -430,6 +442,8 @@ end;
procedure TDcdWrapper.remImportFolder(const folder: string);
begin
if not fCanRemove then
exit;
if not fAvailable or not fServerListening or not fImportCache.contains(folder) then
exit;
@ -446,6 +460,8 @@ var
i: string;
c: integer;
begin
if not fCanRemove then
exit;
if not fAvailable or not fServerListening then
exit;

View File

@ -308,10 +308,7 @@ begin
if fDoc.isNotAssigned then
exit;
if not exeInSysPath('dfmt') then
begin
getMessageDisplay().message('DFMT is missing. See https://github.com/dlang-community/dfmt for more instructions on how to get DFMT.', nil, TAppMessageCtxt.amcAll, TAppMessageKind.amkWarn);
exit;
end;
fBackup.Assign(fDoc.Lines);
prc := TProcess.create(nil);

View File

@ -55,20 +55,20 @@ type
keywordsMap = record
private
{
rendered on 2025-Mar-10 11:20:03.8930671 by IsItThere.
rendered on 2021-Apr-14 18:49:17.621124 by IsItThere.
- PRNG seed: 0
- map length: 512
- case sensitive: true
}
const fWords: array [0..511] of string =
('', '', '', '', 'cdouble', '', '', '', 'creal', '', 'abstract', '', 'ulong', 'uint', '', '', '', '', 'delete', '', '', '', '', '', '', 'while', '', '', '', '', '', 'goto', 'void', '', '', 'ptrdiff_t', '', '', 'extern', '', '', '', '', '__traits', '', '', '', 'ifloat', '', '', 'dchar', 'pure', '', '', '', 'template', '', 'auto', '', 'cast', '', '', 'synchronized', '', '', '', 'union', '', '', '', '', '', '', '', '__parameters', '', 'finally', '', '', 'this', '__rvalue', '', '', 'mixin', 'throw', '', '', '', '', 'class', '', '', '', '', '', '', '', '', '', 'false', '', '', '', '', '', '', '', '', '', '', '', 'continue', '', 'import', '', '', '', 'break', '', '', 'immutable', '', 'cfloat', '', '', 'case', '', 'enum', '', '', 'override', 'public', '', 'cent', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'inout', '', '', '', 'in', '', '', '', '', 'interface', 'true', '', '', 'catch', '', 'string', '', '', 'delegate', '', 'else', '', 'if', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'short', '', '', '', '', '', '', '', '', '', 'const', '', '', '', 'wstring', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'super', '', '', 'package', '', '', '', '__gshared', '', '', '', '', '', '', '', '', '', 'is', '', '', '', '', 'scope', '', '', '__vector', '', 'foreach_reverse', '', '', '', '', 'do', '', '', '', '', '', 'unittest', '', 'switch', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'static', '', '', 'dstring', 'null', '', '', 'byte', '', 'for', 'nothrow', '', '', 'debug', 'return', '', '', '', 'align', '', '', '', '', '', '', 'module', '', 'ucent', 'long', 'int', '', '', '', 'final', '', '', '', '', '', 'shared', '', '', '', '', '', '', '', '', '', '', 'protected', '', 'lazy', '', '', '', '', '', 'private', '', 'invariant', '', '', '', '', '', 'size_t', '', '', 'asm', '', '', 'double', '', '', '', 'real', '', '', '', '', '', '', '', '', '', '', '', '', 'new', '', 'volatile', '', 'alias', '', '', '', 'foreach', '', '', '', '', '', '', '', '', '', '', '', 'ushort', 'ref', 'default', 'typeid', 'assert', '', '', '', '', '', '', '', '', '', 'export', 'char', '', '', '', '', '', '', 'struct', '', '', '', '', '', '', '', '', 'idouble', '', '', '', 'ireal', '', '', '', '', '', '', 'bool', 'typeof', '', '', '', 'pragma', '', '', 'with', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'deprecated', '', '', '', '', 'version', 'try', '', '', '', '', 'wchar', '', 'function', '', 'float', '', '', '', '', '', '', '', '', '', '', '', 'ubyte', '', '', '', '', 'out', '', '', '');
('', '', '', '', '', '', 'scope', '', '', '', '', 'this', 'ucent', 'delegate', 'size_t', '', '', 'ulong', 'nothrow', '', '', 'bool', '', '', '', '', 'debug', '', '', 'class', '', '', 'function', '', '', 'uint', 'private', '', 'for', '', '', '', 'false', 'deprecated', 'mixin', '', 'while', '', '', 'with', '', '', '', 'true', '', '', '', '', '', 'foreach_reverse', '', '', '', 'real', '', '', 'align', '', '', '__vector', '', '', '', '', 'pragma', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'module', '', '', '', '', '', '', '', '', '', '', '', '', '', 'interface', '', '', '', '', '', '', '', '', 'foreach', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'auto', '', 'float', '', 'typeid', 'else', '', 'string', 'creal', 'inout', '', '', 'pure', '', '', '', '', '', '', '', '', '', '', '', 'export', '', '', '', '', '', 'ubyte', 'double', '', '', '', '', '', '', '', 'do', '', '', '', 'union', '', '', '', '', '', 'static', '', 'final', 'ireal', '', '', '', '', '', 'is', '', '', 'immutable', '', 'switch', '', '', '', 'assert', '', '', '', '', 'dstring', '', '__traits', '', '', '', '', '', 'new', 'super', '', '', '', '', '', '', 'typeof', '', '', 'catch', 'short', '', 'alias', '', '', '', 'delete', 'in', '', '', '', '', '', 'cfloat', '', '', '', 'abstract', '', '', '', '__gshared', 'wstring', 'break', '', '', '', 'unittest', '', '', 'struct', '', '', '', '', '', '', '', 'throw', '', '', '', 'cdouble', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'ifloat', 'ptrdiff_t', 'template', 'cent', 'if', '', '', '', 'long', '', '', '', '', '', '', '', '', 'char', '', '', '', 'default', '', '', '', '', 'int', '', '', 'idouble', 'volatile', '', '', '', '', 'version', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'goto', '', '', '', '', '', 'package', '__parameters', '', '', '', '', '', '', '', 'shared', '', '', '', '', '', '', '', '', '', '', '', '', 'dchar', '', '', '', '', '', '', '', '', '', '', '', 'continue', '', '', '', '', '', '', '', '', 'synchronized', '', '', '', 'public', '', '', 'return', '', '', '', '', 'out', '', 'import', '', '', '', 'null', 'protected', '', 'wchar', '', 'finally', '', '', '', 'invariant', '', 'ref', '', 'case', '', '', '', '', '', '', '', '', '', 'asm', '', '', '', '', '', '', '', '', '', '', '', '', 'ushort', 'void', '', '', '', '', '', '', '', '', '', '', '', '', '', 'enum', '', '', '', '', '', '', 'byte', '', '', '', 'const', '', 'lazy', '', '', '', 'cast', '', '', '', 'extern', '', 'try', 'override', '', '', '', '', '', '', '', '');
const fHasEntry: array [0..511] of boolean =
(false, false, false, false, true, false, false, false, true, false, true, false, true, true, false, false, false, false, true, false, false, false, false, false, false, true, false, false, false, false, false, true, true, false, false, true, false, false, true, false, false, false, false, true, false, false, false, true, false, false, true, true, false, false, false, true, false, true, false, true, false, false, true, false, false, false, true, false, false, false, false, false, false, false, true, false, true, false, false, true, true, false, false, true, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, false, false, true, false, false, true, false, true, false, false, true, false, true, false, false, true, true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, true, true, false, false, true, false, true, false, false, true, false, true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, true, false, false, false, false, true, false, false, true, false, true, false, false, false, false, true, false, false, false, false, false, true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, true, false, false, false, true, false, false, false, false, false, false, true, false, true, true, true, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, true, false, true, false, false, false, false, false, true, false, true, false, false, false, false, false, true, false, false, true, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, true, true, false, false, false, true, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, true, true, false, false, false, false, true, false, true, false, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, true, false, false, false);
(false, false, false, false, false, false, true, false, false, false, false, true, true, true, true, false, false, true, true, false, false, true, false, false, false, false, true, false, false, true, false, false, true, false, false, true, true, false, true, false, false, false, true, true, true, false, true, false, false, true, false, false, false, true, false, false, false, false, false, true, false, false, false, true, false, false, true, false, false, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, true, false, true, true, false, true, true, true, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, true, true, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, true, false, true, true, false, false, false, false, false, true, false, false, true, false, true, false, false, false, true, false, false, false, false, true, false, true, false, false, false, false, false, true, true, false, false, false, false, false, false, true, false, false, true, true, false, true, false, false, false, true, true, false, false, false, false, false, true, false, false, false, true, false, false, false, true, true, true, false, false, false, true, false, false, true, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, false, false, false, true, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, true, true, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, true, false, false, false, false, true, false, true, false, false, false, true, true, false, true, false, true, false, false, false, true, false, true, false, true, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true, false, false, false, true, false, true, false, false, false, true, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false);
const fCoeffs: array [0..255] of Byte =
(149, 149, 209, 70, 128, 54, 131, 42, 163, 99, 62, 99, 162, 96, 41, 68, 64, 176, 136, 67, 36, 232, 177, 99, 114, 106, 120, 83, 85, 249, 51, 53, 48, 55, 217, 168, 129, 86, 247, 153, 11, 47, 7, 88, 69, 131, 73, 188, 111, 154, 128, 152, 194, 99, 121, 84, 28, 83, 247, 175, 238, 255, 237, 177, 37, 205, 174, 140, 119, 108, 68, 1, 113, 102, 208, 214, 123, 137, 223, 57, 95, 182, 228, 85, 57, 41, 133, 64, 9, 201, 112, 156, 192, 173, 209, 166, 66, 61, 163, 143, 137, 240, 106, 91, 156, 68, 10, 100, 11, 116, 88, 139, 63, 240, 65, 193, 174, 195, 200, 62, 255, 243, 38, 238, 63, 128, 80, 248, 104, 7, 154, 154, 254, 221, 1, 238, 26, 252, 2, 169, 227, 130, 99, 240, 52, 248, 250, 72, 216, 222, 22, 227, 139, 187, 59, 217, 118, 119, 63, 220, 235, 55, 154, 87, 10, 171, 249, 239, 254, 232, 63, 174, 120, 245, 238, 228, 152, 175, 240, 174, 18, 95, 239, 185, 227, 226, 186, 161, 234, 227, 29, 152, 90, 54, 69, 136, 192, 252, 29, 237, 62, 164, 45, 151, 187, 68, 165, 60, 102, 146, 15, 97, 207, 59, 99, 48, 24, 53, 225, 174, 175, 183, 215, 24, 234, 33, 31, 255, 60, 128, 31, 89, 63, 3, 105, 233, 191, 6, 181, 198, 46, 7, 164, 17, 90, 45, 93, 185, 254, 17, 194, 218, 197, 194, 85, 71);
(38, 33, 180, 0, 185, 246, 108, 140, 101, 70, 225, 36, 169, 241, 207, 131, 8, 145, 253, 246, 120, 51, 192, 218, 141, 3, 128, 13, 153, 122, 147, 180, 155, 253, 108, 112, 81, 69, 216, 179, 91, 136, 140, 39, 226, 59, 35, 105, 3, 111, 139, 247, 35, 246, 8, 124, 74, 191, 207, 221, 168, 208, 182, 40, 125, 146, 113, 139, 166, 251, 161, 145, 87, 99, 57, 74, 153, 249, 60, 234, 254, 164, 213, 146, 164, 14, 30, 121, 56, 203, 76, 11, 44, 178, 124, 193, 12, 248, 217, 103, 65, 21, 164, 21, 231, 147, 173, 45, 52, 134, 110, 132, 193, 209, 254, 69, 76, 214, 121, 107, 18, 172, 20, 89, 137, 103, 6, 153, 190, 154, 210, 136, 72, 198, 124, 133, 215, 154, 155, 198, 121, 208, 215, 184, 239, 210, 214, 130, 231, 158, 210, 177, 16, 39, 121, 200, 101, 187, 168, 82, 237, 94, 101, 118, 255, 207, 85, 168, 217, 106, 177, 5, 88, 246, 217, 77, 204, 40, 208, 142, 96, 217, 123, 31, 20, 237, 212, 146, 9, 168, 103, 214, 167, 134, 75, 204, 86, 62, 164, 83, 131, 236, 14, 131, 31, 66, 95, 70, 166, 134, 47, 8, 171, 76, 79, 136, 237, 10, 178, 22, 235, 255, 228, 205, 162, 40, 103, 57, 169, 153, 164, 128, 28, 5, 216, 168, 35, 121, 33, 96, 39, 72, 230, 91, 54, 134, 223, 59, 5, 166, 146, 71, 188, 129, 179, 117);
class function hash(const w: string): Word; static; {$IFNDEF DEBUG}inline;{$ENDIF}
public
class function match(const w: string): boolean; static; {$IFNDEF DEBUG}inline;{$ENDIF}

View File

@ -12,7 +12,7 @@ type
const
stringPostfixes: TCharSet = ['c', 'w', 'd'];
stringPrefixes: TCharSet = ['r', 'x', 'i', '"'];
stringPrefixes: TCharSet = ['r', 'x', '"'];
stringStopChecks: TCharSet = ['\', '"'];
charStopChecks: TCharSet = ['\', #39];
symbChars: TCharSet = [';', '{', '}', '(', ')', '[', ']', ',', '.', ':', '?', '$', '"', #39];

View File

@ -326,9 +326,9 @@ var
begin
v := new(PSemVer);
if value = 'vmaster' then
v^.init('v0.0.0-master', false)
v^.init('v0.0.0-master')
else try
v^.init(value, true);
v^.init(value);
except
dispose(v);
exit;
@ -1726,18 +1726,18 @@ procedure TDubProject.updateImportPathsFromJson;
p := '0.0.0';
end
else if (p = 'master') or (v = '~master') then
q.init('v0.0.0-master', false)
q.init('v0.0.0-master')
else
begin
try
q.init('v' + p, true);
q.init('v' + p);
except
// while editing a DUB project from the DUB project editor,
// '<value>', i.e "undefined JSON value" can be found here.
// So get DUB to fetch the most recent if the 'autoFetch' IDE option
// is ON, even if another version is set later.
o := '>=';
q.init('v0.0.0', false);
q.init('v0.0.0');
end;
end;

View File

@ -205,7 +205,6 @@ type
procedure openDocument(const fname: string);
function closeDocument(index: Integer;promptOnChanged: boolean = true): boolean;
function closeDocument(doc: TDexedMemo;promptOnChanged: boolean = true): boolean;
procedure forceCaption(doc: TDexedMemo; value: string);
public
constructor create(aOwner: TComponent); override;
destructor destroy; override;
@ -670,11 +669,6 @@ begin
exit(false);
exit(closeDocument(page.index, promptOnChanged));
end;
procedure TEditorWidget.forceCaption(doc: TDexedMemo; value: string);
begin
TDexedPage(doc.Parent).fixedCaption := value;
end;
{$ENDREGION}
{$REGION PageControl/Editor things ---------------------------------------------}

View File

@ -320,8 +320,6 @@ type
function closeDocument(doc: TDexedMemo; promptOnChanged: boolean = true): boolean;
// conveniance property.
property document[index: integer]: TDexedMemo read getDocument;
// force page caption
procedure forceCaption(doc: TDexedMemo; value: string);
end;

View File

@ -16,8 +16,7 @@ uses
u_toolseditor, u_procinput, u_optionseditor, u_symlist, u_mru, u_processes,
u_infos, u_dubproject, u_dialogs, u_dubprojeditor, u_gdb, u_makeproject,
u_dfmt, u_lcldragdrop, u_projgroup, u_projutils, u_stringrange, u_dexed_d,
u_halstead, u_profileviewer, u_semver, u_dsgncontrols, u_term, u_newdubproj,
u_blame;
u_halstead, u_profileviewer, u_semver, u_dsgncontrols, u_term, u_newdubproj;
type
@ -438,7 +437,6 @@ type
fDubProjWidg: TDubProjectEditorWidget;
fPrjGrpWidg: TProjectGroupWidget;
fGdbWidg: TGdbWidget;
fBlameWidg: TBlameWidget;
{$IFDEF UNIX}
fTermWidg: TTermWidget;
{$ENDIF}
@ -1664,7 +1662,6 @@ begin
fPrjGrpWidg := TProjectGroupWidget.create(self);
fProfWidg := TProfileViewerWidget.create(self);
fGdbWidg := TGdbWidget.create(self);
fBlameWidg := TBlameWidget.create(self);
{$IFDEF UNIX}
fTermWidg := TTermWidget.create(self);
{$ENDIF}
@ -1690,7 +1687,6 @@ begin
fWidgList.addWidget(@fPrjGrpWidg);
fWidgList.addWidget(@fProfWidg);
fWidgList.addWidget(@fGdbWidg);
fWidgList.addWidget(@fBlameWidg);
{$IFDEF UNIX}
fWidgList.addWidget(@fTermWidg);
{$ENDIF}
@ -2969,7 +2965,7 @@ begin
if fDoc.SelAvail then
str := fDoc.SelText
else
str := fDoc.HighlightedIdent;
str := fDoc.Identifier;
ffindwidg.cbToFind.Text := str;
ffindwidg.cbToFindChange(nil);
ffindwidg.cbToFind.SetFocus;

View File

@ -161,7 +161,7 @@ type
function optionedOptionsModified: boolean;
//
function openFileFromDmdMessage(const aMessage: string): boolean;
class function getLineFromMessage(const aMessage: string): TPoint;
function getLineFromMessage(const aMessage: string): TPoint;
function guessMessageKind(const aMessg: string): TAppMessageKind;
//
function singleServiceName: string;
@ -1239,7 +1239,7 @@ begin
end;
end;
class function TMessagesWidget.getLineFromMessage(const aMessage: string): TPoint;
function TMessagesWidget.getLineFromMessage(const aMessage: string): TPoint;
var
rng: TStringRange = (ptr:nil; pos:0; len: 0);
lne: string;
@ -1259,11 +1259,8 @@ begin
if gnuStyle then
begin
lne := rng.takeUntil([':', ' ']).yield;
//lne := rng.takeWhile(['1'..'9']).yield;
//rng.popWhile(' ');
if rng.front = ':' then
//col := rng.popFront()^.takeUntil([' ', ':']).yield;
col := rng.popFront()^.takeUntil([' ', ':']).yield;
col := rng.popWhile(':')^.takeUntil(' ').yield;
end else
begin
rng.popWhile(['(', ':']);
@ -1353,13 +1350,4 @@ begin
end;
{$ENDREGION}
{$IFDEF DEBUG}
begin
//assert(TMessagesWidget.getLineFromMessage('home/xxx/temp/temp.sx:8 : erreur : référence à « BAD » non définie') = Point(-1,8));
assert(TMessagesWidget.getLineFromMessage('home/xxx/temp/temp.sx:8: erreur : référence à « BAD » non définie') = Point(-1,8));
assert(TMessagesWidget.getLineFromMessage('home/xxx/temp/temp.sx:18:12: erreur : référence à « BAD » non définie') = Point(12,18));
assert(TMessagesWidget.getLineFromMessage('home/xxx/temp/temp.sx(8,12): erreur : référence à « BAD » non définie') = Point(12,8));
assert(TMessagesWidget.getLineFromMessage('home/xxx/temp/temp.sx(8): erreur : référence à « BAD » non définie') = Point(-1,8));
assert(TMessagesWidget.getLineFromMessage('/home/basile/Bureau/temp/temp.sx:10:12: warning, variable `c` is never used') = Point(12,10));
{$ENDIF}
end.

View File

@ -21,7 +21,7 @@ inherited MiniExplorerWidget: TMiniExplorerWidget
Top = 0
Width = 527
Align = alTop
Columns = <
Columns = <
item
Width = 525
end>
@ -84,51 +84,23 @@ inherited MiniExplorerWidget: TMiniExplorerWidget
ObjectTypes = [otFolders]
ShellListView = lstFiles
end
object Panel1: TPanel
object lstFiles: TShellListView
Left = 0
Height = 162
Top = 224
Width = 527
Align = alClient
Caption = 'Panel1'
ClientHeight = 162
ClientWidth = 527
Color = clDefault
DragMode = dmAutomatic
ReadOnly = True
ScrollBars = ssAutoBoth
SortType = stText
TabOrder = 2
object lstFilter: TListViewFilterEdit
Left = 3
Height = 30
Top = 3
Width = 521
ButtonWidth = 23
Flat = True
Align = alTop
BorderSpacing.Around = 2
NumGlyphs = 1
MaxLength = 0
TabOrder = 0
OnButtonClick = lstFilterButtonClick
OnKeyUp = lstFilterKeyUp
end
object lstFiles: TShellListView
Left = 1
Height = 126
Top = 35
Width = 525
Align = alClient
Color = clDefault
DragMode = dmAutomatic
ReadOnly = True
ScrollBars = ssAutoBoth
SortColumn = 0
SortType = stText
TabOrder = 1
OnColumnClick = lstFilesColumnClick
OnDblClick = lstFilesDblClick
OnMouseMove = lstFilesMouseMove
OnFileAdded = lstFilesFileAdded
ObjectTypes = [otNonFolders, otHidden]
ShellTreeView = treeFolders
end
OnColumnClick = lstFilesColumnClick
OnDblClick = lstFilesDblClick
OnFileAdded = lstFilesFileAdded
ObjectTypes = [otNonFolders, otHidden]
ShellTreeView = treeFolders
end
end
end
@ -197,12 +169,28 @@ inherited MiniExplorerWidget: TMiniExplorerWidget
resourceName = 'GO_PREVIOUS'
scaledSeparator = False
end
object lstFilter: TListViewFilterEdit[6]
Left = 191
Height = 26
Top = 2
Width = 329
ButtonWidth = 23
Flat = True
Align = alClient
BorderSpacing.Left = 180
BorderSpacing.Around = 2
NumGlyphs = 1
MaxLength = 0
TabOrder = 0
OnButtonClick = lstFilterButtonClick
OnKeyUp = lstFilterKeyUp
end
end
inherited contextMenu: TPopupMenu
Left = 40
Top = 48
end
object mnuDrives: TPopupMenu[3]
object mnuDrives: TPopupMenu[2]
Left = 8
Top = 48
end

View File

@ -22,8 +22,6 @@ type
fDblClick: TExplorerDoubleClick;
fContextExpand: boolean;
fShowHidden: boolean;
fShowSize: boolean;
fShowType: boolean;
fExplorer: TMiniExplorerWidget;
function optionedWantCategory(): string;
function optionedWantEditorKind: TOptionEditorKind;
@ -35,8 +33,6 @@ type
property doubleClick: TExplorerDoubleClick read fDblClick write fDblClick;
property contextExpand: boolean read fContextExpand write fContextExpand;
property showHidden: boolean read fShowHidden write fShowHidden default true;
property showSize: boolean read fShowSize write fShowSize default true;
property showType: boolean read fShowType write fShowType default true;
public
constructor create(miniexpl: TMiniExplorerWidget);
destructor destroy; override;
@ -48,24 +44,18 @@ type
fSplitter1Position: integer;
fSplitter2Position: integer;
fLastFolder: string;
fRootFolder: string;
fDblClick: TExplorerDoubleClick;
fContextExpand: boolean;
fShowHidden: boolean;
fShowSize: boolean;
fShowType: boolean;
procedure setFavoriteFolders(value: TStringList);
published
property splitter1Position: integer read fSplitter1Position write fSplitter1Position;
property splitter2Position: integer read fSplitter2Position write fSplitter2Position;
property lastFolder: string read fLastFolder;
property rootFolder: string read fRootFolder write fRootFolder;
property lastFolder: string read fLastFolder write fLastFolder;
property favoriteFolders: TStringList read fFavoriteFolders write setFavoriteFolders;
property doubleClick: TExplorerDoubleClick read fDblClick write fDblClick;
property contextExpand: boolean read fContextExpand write fContextExpand;
property showHidden: boolean read fShowHidden write fShowHidden default true;
property showSize: boolean read fShowSize write fShowSize default true;
property showType: boolean read fShowType write fShowType default true;
public
constructor create(aOwner: TComponent); override;
destructor destroy; override;
@ -84,7 +74,6 @@ type
btnShellOpen: TDexedToolButton;
lstFilter: TListViewFilterEdit;
lstFav: TListView;
Panel1: TPanel;
Panel2: TPanel;
lstFiles: TShellListView;
mnuDrives: TPopupMenu;
@ -104,8 +93,6 @@ type
procedure lstFilesDblClick(Sender: TObject);
procedure lstFilesEnter(Sender: TObject);
procedure lstFilesFileAdded(Sender: TObject; Item: TListItem);
procedure lstFilesMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure lstFilterButtonClick(Sender: TObject);
procedure lstFilterKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure Splitter2MouseWheel(Sender: TObject; Shift: TShiftState;
@ -175,8 +162,6 @@ constructor TMiniExplorerEditableOptions.create(miniexpl: TMiniExplorerWidget);
begin
fExplorer := miniexpl;
fShowHidden:=true;
fShowSize:=true;
fShowType:=true;
EntitiesConnector.addObserver(self);
end;
@ -200,8 +185,6 @@ begin
fExplorer.treeFolders.ObjectTypes := fExplorer.treeFolders.ObjectTypes - [otHidden];
fExplorer.lstFiles.ObjectTypes := fExplorer.lstFiles.ObjectTypes - [otHidden];
end;
fExplorer.lstFiles.Columns[1].Visible := fShowSize;
fExplorer.lstFiles.Columns[2].Visible := fShowType;
fExplorer.treeFolders.Refresh;
end;
@ -237,8 +220,6 @@ begin
inherited;
fFavoriteFolders := TStringList.Create;
fShowHidden:=true;
fShowType:=true;
fShowSize:=true;
end;
destructor TMiniExplorerOptions.destroy;
@ -256,14 +237,11 @@ begin
widg := TMiniExplorerWidget(source);
fFavoriteFolders.Assign(widg.fFavorites);
fLastFolder := widg.fLastFold;
fRootFolder := widg.treeFolders.Root;
fSplitter1Position := widg.Splitter1.GetSplitterPosition;
fSplitter2Position := widg.Splitter2.GetSplitterPosition;
fDblClick:= widg.fDblClick;
fContextExpand:=widg.fContextExpand;
fShowHidden:= otHidden in widg.lstFiles.ObjectTypes;
fShowSize := widg.lstFiles.Columns[1].Visible;
fShowType := widg.lstFiles.Columns[2].Visible;
end
else inherited;
end;
@ -294,11 +272,7 @@ begin
widg.treeFolders.ObjectTypes := widg.treeFolders.ObjectTypes - [otHidden];
widg.lstFiles.ObjectTypes := widg.lstFiles.ObjectTypes -[otHidden];
end;
widg.lstFiles.Columns[1].Visible := fShowSize;
widg.lstFiles.Columns[2].Visible := fShowType;
if fRootFolder.isNotEmpty and fRootFolder.dirExists then
widg.browse(fRootFolder)
else if fLastFolder.isNotEmpty and fLastFolder.dirExists then
if widg.fLastFold.dirExists then
widg.browse(fLastFolder);
end
else inherited;
@ -378,6 +352,8 @@ begin
lstFav.OnSelectItem := @lstFavSelect;
lstFav.OnDblClick := @lstFavDblClick;
lstFilter.BorderSpacing.Left := ScaleX(182, 96);
treeSetRoots;
fname := getDocPath + OptsFname;
@ -759,20 +735,13 @@ begin
lstFiles.Sort;
end;
procedure TMiniExplorerWidget.lstFilesMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
i: TListItem;
begin
i := lstFiles.GetItemAt(x,y);
if i.isAssigned() then
begin
lstFiles.Hint := i.Caption;
end;
end;
procedure TMiniExplorerWidget.lstFilterButtonClick(Sender: TObject);
var
s: string;
begin
filterFiles;
s := treeFolders.Root;
treeFolders.Root:= '';
treeFolders.Root:= s;
end;
procedure TMiniExplorerWidget.lstFilterKeyUp(Sender: TObject; var Key: Word;
@ -800,6 +769,7 @@ end;
procedure TMiniExplorerWidget.toolbarResize(Sender: TObject);
begin
lstFilter.Width := toolbar.Width - lstFilter.Left - lstFilter.BorderSpacing.Around;
end;
procedure TMiniExplorerWidget.shellOpenSelected;

View File

@ -8,13 +8,12 @@ inherited SearchWidget: TSearchWidget
ClientWidth = 422
inherited Content: TPanel
Height = 293
Top = 36
Width = 422
ClientHeight = 293
ClientWidth = 422
object cbToFind: TComboBox[0]
Left = 4
Height = 30
Height = 27
Top = 4
Width = 414
Align = alTop
@ -23,15 +22,15 @@ inherited SearchWidget: TSearchWidget
BorderSpacing.Around = 4
ItemHeight = 0
MaxLength = 128
TabOrder = 0
OnChange = cbToFindChange
OnKeyDown = cbToFindKeyDown
OnSelect = cbToFindChange
TabOrder = 0
end
object btnFind: TBitBtn[1]
Left = 4
Height = 32
Top = 149
Height = 27
Top = 169
Width = 414
Align = alBottom
AutoSize = True
@ -41,8 +40,8 @@ inherited SearchWidget: TSearchWidget
end
object btnReplace: TBitBtn[2]
Left = 4
Height = 32
Top = 221
Height = 27
Top = 231
Width = 414
Align = alBottom
AutoSize = True
@ -52,50 +51,50 @@ inherited SearchWidget: TSearchWidget
end
object grpOpts: TGroupBox[3]
Left = 4
Height = 73
Top = 72
Height = 99
Top = 66
Width = 414
Align = alClient
AutoSize = True
BorderSpacing.Around = 4
Caption = 'Options'
ClientHeight = 54
ClientWidth = 412
ClientHeight = 80
ClientWidth = 410
TabOrder = 4
object FlowPanel1: TFlowPanel
Left = 0
Height = 54
Height = 80
Top = 0
Width = 412
Width = 410
Align = alClient
AutoSize = True
BevelOuter = bvNone
ControlList = <
ControlList = <
item
Control = chkRegex
WrapAfter = waAuto
Index = 0
end
end
item
Control = chkPrompt
WrapAfter = waAuto
Index = 1
end
end
item
Control = chkCaseSens
WrapAfter = waAuto
Index = 2
end
end
item
Control = chkFromCur
WrapAfter = waAuto
Index = 3
end
end
item
Control = chkBack
WrapAfter = waAuto
Index = 4
end
end
item
Control = chkWWord
WrapAfter = waAuto
@ -106,9 +105,9 @@ inherited SearchWidget: TSearchWidget
TabOrder = 0
object chkRegex: TCheckBox
Left = 0
Height = 23
Height = 22
Top = 0
Width = 94
Width = 100
Anchors = []
Caption = 'allow regex'
Checked = True
@ -117,27 +116,27 @@ inherited SearchWidget: TSearchWidget
end
object chkPrompt: TCheckBox
Left = 0
Height = 23
Top = 24
Width = 72
Height = 22
Top = 23
Width = 71
Anchors = []
Caption = 'prompt'
TabOrder = 1
end
object chkCaseSens: TCheckBox
Left = 94
Height = 23
Top = 0
Width = 107
Left = 0
Height = 22
Top = 46
Width = 117
Anchors = []
Caption = 'case sensitive'
TabOrder = 2
end
object chkFromCur: TCheckBox
Left = 94
Height = 23
Top = 24
Width = 96
Left = 117
Height = 22
Top = 0
Width = 99
Anchors = []
Caption = 'from cursor'
Checked = True
@ -145,19 +144,19 @@ inherited SearchWidget: TSearchWidget
TabOrder = 3
end
object chkBack: TCheckBox
Left = 201
Height = 23
Top = 0
Width = 84
Left = 117
Height = 22
Top = 23
Width = 87
Anchors = []
Caption = 'backward'
TabOrder = 4
end
object chkWWord: TCheckBox
Left = 201
Height = 23
Top = 24
Width = 96
Left = 117
Height = 22
Top = 46
Width = 99
Anchors = []
Caption = 'whole word'
Checked = True
@ -168,8 +167,8 @@ inherited SearchWidget: TSearchWidget
end
object btnReplaceAll: TBitBtn[4]
Left = 4
Height = 32
Top = 257
Height = 27
Top = 262
Width = 414
Align = alBottom
AutoSize = True
@ -179,69 +178,69 @@ inherited SearchWidget: TSearchWidget
end
object Panel1: TPanel[5]
Left = 4
Height = 30
Top = 38
Height = 27
Top = 35
Width = 414
Align = alTop
AutoSize = True
BorderSpacing.Around = 4
BevelOuter = bvNone
ClientHeight = 30
ClientHeight = 27
ClientWidth = 414
TabOrder = 5
object cbReplaceWth: TComboBox
Left = 104
Height = 30
Left = 111
Height = 27
Top = 0
Width = 310
Width = 303
Align = alClient
AutoComplete = True
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchCaseSensitive, cbactSearchAscending]
ItemHeight = 0
MaxLength = 128
TabOrder = 1
OnChange = cbReplaceWthChange
OnKeyDown = cbReplaceWthKeyDown
OnSelect = cbReplaceWthChange
TabOrder = 1
end
object chkEnableRep: TCheckBox
Left = 0
Height = 30
Height = 27
Top = 0
Width = 104
Width = 111
Align = alLeft
Caption = 'Replace with '
TabOrder = 0
OnChange = chkEnableRepChange
TabOrder = 0
end
end
object Panel2: TPanel[6]
Left = 4
Height = 32
Top = 185
Height = 27
Top = 200
Width = 414
Align = alBottom
AutoSize = True
BorderSpacing.Around = 4
BevelOuter = bvNone
ClientHeight = 32
ClientHeight = 27
ClientWidth = 414
TabOrder = 6
object btnFindAll: TBitBtn
Left = 0
Height = 32
Height = 27
Top = 0
Width = 398
Width = 402
Align = alClient
AutoSize = True
Caption = 'btnFindAll'
TabOrder = 0
end
object btnAllScope: TBitBtn
Left = 400
Height = 32
Left = 404
Height = 27
Top = 0
Width = 14
Width = 10
Align = alRight
AutoSize = True
BorderSpacing.Left = 2
@ -257,7 +256,7 @@ inherited SearchWidget: TSearchWidget
Left = 216
Top = 16
end
object imgList: TImageList[3]
object imgList: TImageList[2]
Left = 248
Top = 16
Bitmap = {

View File

@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes,
RegExpr, SynEditTextBuffer, strutils, LCLType,
RegExpr, SynEditTextBuffer, strutils,
u_common, u_mru, u_widget, u_synmemo, u_interfaces, u_observer,
u_writableComponent, u_dialogs, u_sharedres, u_dsgncontrols;
@ -762,16 +762,13 @@ begin
fToFind := cbToFind.Text;
fHasSearched := false;
updateImperative;
if fDoc.isAssigned and (not chkRegex.Checked) then
fDoc.HighlightedIdent := fToFind;
end;
procedure TSearchWidget.cbToFindKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = 13 then
actFindNextExecute(nil)
else if (key = VK_ESCAPE) and fDoc.isAssigned then
fDoc.setFocus;
if Key <> 13 then
exit;
actFindNextExecute(nil);
end;
procedure TSearchWidget.chkEnableRepChange(Sender: TObject);

View File

@ -20,7 +20,7 @@ type
public
// Initializes with the semVer text.
// When throw is set to true an Exception is raised if the format is not compliant.
procedure init(const text: string; throw: boolean);
procedure init(const text: string; throw: boolean = true);
// Indicates wether the version is not a final release.
function isPreRelease: boolean;
@ -58,7 +58,7 @@ implementation
var v1, v2: TSemVer;
{$ENDIF}
procedure TSemVer.init(const text: string; throw: boolean);
procedure TSemVer.init(const text: string; throw: boolean = true);
procedure resetFields();
begin
@ -84,12 +84,12 @@ begin
if throw and (r.front <> 'v') then
error('Invalid semVer format, the text must start with "v"');
r.popFront;
fMajor := StrToInt64Def(r.takeUntil('.').yield, 0);
fMajor := r.takeUntil('.').yield.ToInteger;
if throw and r.empty then
error('Invalid semVer format, minor and patch miss');
fMinor := StrToInt64Def(r.popFront^.takeUntil('.').yield, 0);
fMinor := r.popFront^.takeUntil('.').yield.ToInteger;
if not r.empty then
fPatch := StrToInt64Def(r.popFront^.takeWhile(['0'..'9']).yield, 0);
fPatch := r.popFront^.takeWhile(['0'..'9']).yield.ToInteger;
if not r.empty then
fAdditional := r.popFront^.takeUntil(#0).yield;
fValid := true;
@ -146,46 +146,46 @@ end;
{$IFDEF DEBUG}
begin
v1.init('v1.0.0', true);
v2.init('v1.0.0', true);
v1.init('v1.0.0');
v2.init('v1.0.0');
assert(v1 = v2);
v1.init('v2.0.0', true);
v2.init('v1.0.0', true);
v1.init('v2.0.0');
v2.init('v1.0.0');
assert(v1 > v2);
assert(v2 < v1);
v1.init('v1.1.0', true);
v2.init('v1.0.0', true);
v1.init('v1.1.0');
v2.init('v1.0.0');
assert(v1 > v2);
assert(v2 < v1);
v1.init('v1.1.1', true);
v2.init('v1.1.0', true);
v1.init('v1.1.1');
v2.init('v1.1.0');
assert(v1 > v2);
assert(v2 < v1);
v1.init('v1.1.1', true);
v2.init('v1.0.1', true);
v1.init('v1.1.1');
v2.init('v1.0.1');
assert(v1 > v2);
assert(v2 < v1);
v1.init('v1.1.1-alpha.2', true);
v2.init('v1.1.1-alpha.1', true);
v1.init('v1.1.1-alpha.2');
v2.init('v1.1.1-alpha.1');
assert(v1 > v2);
assert(v1.isAlpha);
assert(v2.isAlpha);
assert(v2.asString = '1.1.1-alpha.1');
v1.init('v1.1.1-beta.1', true);
v2.init('v1.1.1-alpha.8', true);
v1.init('v1.1.1-beta.1');
v2.init('v1.1.1-alpha.8');
assert(v1 > v2);
assert(v1.isBeta);
assert(v2.isAlpha);
assert(v1.isPreRelease);
v1.init('v1.2.3', true);
v2.init('v1.22.33', true);
v1.init('v1.2.3');
v2.init('v1.22.33');
assert(v1.major = 1);
assert(v1.minor = 2);
assert(v1.patch = 3);
@ -194,7 +194,7 @@ begin
assert(v2.patch = 33);
assert(v2.asString = '1.22.33');
v1.init('v0.0.2060', true);
v1.init('v0.0.2060');
assert(v1.major = 0);
assert(v1.minor = 0);
assert(v1.patch = 2060);
@ -204,7 +204,7 @@ begin
assert(v2.minor = 0);
assert(v2.patch = 2060);
v1.init('v0.6.0', true);
v1.init('v0.6.0');
assert(v1.major = 0);
assert(v1.minor = 6);
assert(v1.patch = 0);

View File

@ -15,17 +15,17 @@ type
private
{
rendered on 2024-Feb-21 05:21:19.9635608 by IsItThere.
rendered on 2023-Sep-10 22:02:01.9295926 by IsItThere.
- PRNG seed: 6574
- map length: 128
- case sensitive: true
}
const fWords: array [0..127] of string =
('label', 'switch', '', 'goto', '', '', '', 'char', 'delete', 'var', '', '', '', '', '', 'apply', '', '', 'on', '', '', 'from', 'alias', '', '', '', 'static', 'super', 'overload', 'usize', '', 'false', '', 'template', 'continue', '', '', 'this', 'new', 'in', 'foreach', 'throw', 'u8', '', '', '', '', 'const', 'break', 'union', '', 'ssize', 'true', '', 'class', '', 'unit', 'version', '', '', '', '', 'asm', '', 's8', 'echo', '', '', '', '', '', 'u16', '', '', '', 'function', 'protection', 'enum', '', 'while', 'defer', '', '', 'return', 'if', '', '', 'u32', '', '', '', 'else', '', 's16', 'import', '', 'auto', 'try', 'bool', '', '', '', 'finally', '', 'null', 'u64', 'f32', '', '', 's32', '', 'struct', '', '', '', 'assert', 'do', '', '', '', '', '', '', '', 'f64', 'with', '', 's64');
('label', 'switch', '', 'goto', '', '', '', '', 'delete', 'var', '', '', '', '', '', 'apply', '', '', 'on', '', '', 'from', 'alias', '', '', '', 'static', 'super', 'overload', 'usize', '', 'false', '', 'template', 'continue', '', '', 'this', 'new', 'in', 'foreach', 'throw', 'u8', '', '', '', '', 'const', 'break', 'union', '', 'ssize', 'true', '', 'class', '', 'unit', 'version', '', '', '', '', 'asm', '', 's8', 'echo', '', '', '', '', '', 'u16', '', '', '', 'function', 'protection', 'enum', '', 'while', '', '', '', 'return', 'if', '', '', 'u32', '', '', '', 'else', '', 's16', 'import', '', 'auto', 'try', 'bool', '', '', '', 'finally', '', 'null', 'u64', 'f32', '', '', 's32', '', 'struct', '', '', '', 'assert', 'do', '', '', '', '', '', '', '', 'f64', 'with', '', 's64');
const fFilled: array [0..127] of boolean =
(true, true, false, true, false, false, false, true, true, true, false, false, false, false, false, true, false, false, true, false, false, true, true, false, false, false, true, true, true, true, false, true, false, true, true, false, false, true, true, true, true, true, true, false, false, false, false, true, true, true, false, true, true, false, true, false, true, true, false, false, false, false, true, false, true, true, false, false, false, false, false, true, false, false, false, true, true, true, false, true, true, false, false, true, true, false, false, true, false, false, false, true, false, true, true, false, true, true, true, false, false, false, true, false, true, true, true, false, false, true, false, true, false, false, false, true, true, false, false, false, false, false, false, false, true, true, false, true);
(true, true, false, true, false, false, false, false, true, true, false, false, false, false, false, true, false, false, true, false, false, true, true, false, false, false, true, true, true, true, false, true, false, true, true, false, false, true, true, true, true, true, true, false, false, false, false, true, true, true, false, true, true, false, true, false, true, true, false, false, false, false, true, false, true, true, false, false, false, false, false, true, false, false, false, true, true, true, false, true, false, false, false, true, true, false, false, true, false, false, false, true, false, true, true, false, true, true, true, false, false, false, true, false, true, true, true, false, false, true, false, true, false, false, false, true, true, false, false, false, false, false, false, false, true, true, false, true);
const fCoefficients: array [0..255] of Byte =
(37, 236, 86, 118, 73, 206, 4, 48, 111, 209, 73, 137, 75, 157, 197, 152, 28, 40, 164, 170, 89, 179, 110, 152, 34, 12, 168, 23, 76, 66, 91, 217, 64, 82, 153, 12, 185, 137, 120, 56, 55, 132, 75, 141, 42, 119, 214, 156, 103, 102, 23, 72, 8, 181, 233, 248, 50, 191, 134, 63, 153, 91, 211, 31, 248, 110, 52, 135, 183, 250, 187, 30, 201, 228, 26, 255, 211, 174, 96, 188, 196, 206, 170, 218, 210, 19, 147, 137, 85, 186, 122, 214, 221, 218, 67, 147, 91, 27, 241, 246, 192, 226, 11, 2, 53, 201, 105, 1, 137, 149, 94, 180, 242, 169, 65, 14, 25, 248, 173, 230, 80, 135, 108, 41, 129, 206, 58, 41, 231, 66, 9, 230, 66, 181, 237, 77, 132, 143, 61, 65, 125, 248, 77, 147, 107, 74, 69, 83, 82, 217, 61, 119, 70, 229, 222, 170, 236, 100, 226, 92, 167, 163, 84, 207, 175, 75, 43, 27, 105, 100, 137, 0, 50, 34, 66, 135, 19, 75, 41, 113, 105, 88, 81, 86, 255, 235, 167, 229, 20, 181, 28, 233, 251, 234, 32, 117, 113, 48, 178, 193, 180, 111, 116, 38, 1, 16, 93, 108, 26, 83, 202, 163, 49, 177, 142, 229, 120, 149, 99, 182, 110, 136, 118, 198, 153, 237, 92, 131, 160, 58, 248, 253, 183, 192, 200, 200, 172, 192, 213, 137, 2, 208, 24, 94, 17, 41, 66, 9, 196, 119, 30, 99, 11, 28, 148, 180);
@ -91,7 +91,6 @@ type
procedure lexFloatingLiteralFractionalPart();
procedure lexExponent();
procedure lexStringLiteral();
procedure lexCharLiteral();
procedure lexRawStringLiteral();
procedure lexLineComment();
procedure lexStarComment();
@ -578,25 +577,6 @@ begin
end;
end;
procedure TSynSxSyn.lexCharLiteral();
begin
fTokKind := TTokenKind.tkStrng;
fTokStop += 1;
while fTokStop <= fLineBuf.length do
begin
case fLineBuf[fTokStop] of
'\' : fTokStop += 2;
#39 :
begin
fTokStop += 1;
exit;
end
else fTokStop += 1;
end;
end;
fTokKind := TTokenKind.tkError;
end;
procedure TSynSxSyn.lexStringLiteral();
var
firstLine: Boolean;
@ -695,12 +675,21 @@ begin
while fTokStop <= fLineBuf.length do
begin
case fLineBuf[fTokStop] of
'_', 'a'..'z', 'A'..'Z', '0'..'9':
'_', 'a'..'z', 'A'..'Z':
begin
oneChr := true;
fTokStop += 1;
continue;
end;
'0' .. '9':
begin
if oneChr then
begin
fTokStop += 1;
continue;
end
else break; // e.g $0
end
else break;
end;
end;
@ -790,8 +779,6 @@ begin
end;
// number
'1' .. '9' : lexIntLiteral();
// char
#39 : lexCharLiteral();
// "string"
'"': lexStringLiteral();
// `string`
@ -811,16 +798,7 @@ begin
'>': lexOpAndOpOpAndOpEqualAndOpOpEqual('>');
// `=`, `==`, `=>`
'=': lexAssEquOrLambda();
'.':
begin
nextPChar := safeLookupChar();
fTokKind := TTokenKind.tkSymbl;
if (nextPChar <> nil) and (nextPChar^ = '=') then
fTokStop += 2
else
fTokStop += 1;
end;
'(', ')', ',', ':' , '[', ']', ';' :
'.', '(', ')', ',', ':' , '[', ']', ';' :
begin
fTokKind := TTokenKind.tkSymbl;
fTokStop += 1;

View File

@ -209,8 +209,8 @@ begin
fSymbols[CFF] := fDoc.fileName;
fSymbols[CFR] := fSymbols[CFF].stripFileExt + exeExt;
fSymbols[CFP] := fSymbols[CFF].extractFilePath;
if fDoc.HighlightedIdent.isNotEmpty then
fSymbols[CI] := fDoc.HighlightedIdent;
if fDoc.Identifier.isNotEmpty then
fSymbols[CI] := fDoc.Identifier;
fSymbols[CL] := fDoc.LineText;
fSymbols[CS] := fDoc.SelText;
end;

View File

@ -9,8 +9,9 @@ uses
SynEdit, SynPluginSyncroEdit, SynCompletion, SynEditKeyCmds, LazSynEditText,
SynHighlighterLFM, SynEditHighlighter, SynEditMouseCmds, SynEditFoldedView,
SynEditMarks, SynEditTypes, SynHighlighterJScript, SynBeautifier, dialogs,
md5, Spin, LCLIntf, LazFileUtils, LMessages, SynHighlighterCpp,
md5, Spin, LCLIntf, LazFileUtils, LMessages, SynHighlighterCpp, math,
SynGutterBase, LCLVersion, SynEditMiscProcs,
//SynEditMarkupFoldColoring,
Clipbrd, fpjson, jsonparser, LazUTF8, Buttons, StdCtrls,
u_common, u_writableComponent, u_d2syn, u_txtsyn, u_dialogs, u_sxsyn,
u_sharedres, u_dlang, u_stringrange, u_dbgitf, u_observer, u_diff,
@ -190,6 +191,7 @@ type
TDexedMemo = class(TSynEdit, IDebugObserver)
private
//fIndentGuideMarkup: TSynEditMarkupFoldColors;
fLifeTimeManager: TObject;
fIdentDialShown: boolean;
fScrollMemo: TScrollMemo;
@ -199,7 +201,7 @@ type
fCacheLoaded: boolean;
fIsDSource: boolean;
fFocusForInput: boolean;
fHighlightedIdent: string;
fIdentifier: string;
fTempFileName: string;
fMultiDocSubject: TObject;
fDefaultFontSize: Integer;
@ -265,7 +267,7 @@ type
procedure setMatchOpts(value: TIdentifierMatchOptions);
function getMouseBytePosition: Integer;
procedure changeNotify(Sender: TObject);
procedure highlightCurrentIdentifier(fromEditor: boolean = true);
procedure highlightCurrentIdentifier;
procedure saveCache;
procedure loadCache;
class procedure cleanCache; static;
@ -319,7 +321,6 @@ type
procedure debugBreak(const fname: string; line: integer; reason: TDebugBreakReason);
function breakPointsCount: integer;
procedure tryToPatchMixedIndentation;
procedure setHighligthedIdent(value: string);
protected
procedure DoEnter; override;
procedure DoExit; override;
@ -385,10 +386,9 @@ type
procedure redoAll();
procedure undoAll();
procedure scrollCentered(down: boolean);
procedure setHighligtherFrom(other: TDexedMemo);
//
property IdentifierMatchOptions: TIdentifierMatchOptions read fMatchOpts write setMatchOpts;
property HighlightedIdent: string read fHighlightedIdent write setHighligthedIdent;
property Identifier: string read fIdentifier;
property fileName: string read fFilename;
property modified: boolean read fModified;
property tempFilename: string read fTempFileName;
@ -1246,6 +1246,9 @@ begin
LineHighlightColor.Background := color - $080808;
LineHighlightColor.Foreground := clNone;
//fIndentGuideMarkup:= TSynEditMarkupFoldColors.Create(self);
//MarkupManager.AddMarkUp(fIndentGuideMarkup);
fAutoCloseCurlyBrace:= autoCloseOnNewLineLexically;
fAutoClosedPairs:= [autoCloseSquareBracket];
@ -1265,6 +1268,7 @@ destructor TDexedMemo.destroy;
begin
saveCache;
//fIndentGuideMarkup.Free;
EntitiesConnector.removeObserver(self);
subjDocClosing(TMultiDocSubject(fMultiDocSubject), self);
fMultiDocSubject.Free;
@ -2146,9 +2150,10 @@ end;
procedure TDexedMemo.centerCursor();
var
Y, LinesInWin, NewTopLine: Integer;
Y, LinesInWin, CurTopLine, NewTopLine: Integer;
begin
LinesInWin := LinesInWindow;
CurTopLine := TopView;
Y := ToPos(TextView.TextToViewIndex(ToIdx(CaretY)));
NewTopLine := Max(1, Y - (LinesInWin div 2));
if NewTopLine < 1 then NewTopLine := 1;
@ -2169,21 +2174,6 @@ begin
end;
end;
procedure TDexedMemo.setHighligtherFrom(other: TDexedMemo);
begin
if other.Highlighter = other.TxtHighlighter then
Highlighter := TxtHighlighter
else if other.Highlighter = other.D2Highlighter then
Highlighter := D2Highlighter
else if other.Highlighter = other.SxHighlighter then
Highlighter := SxHighlighter
else if other.Highlighter = other.CppHighlighter then
Highlighter := CppHighlighter
// LFM, JSON, etc. are shared instances
else
Highlighter := other.Highlighter;
end;
procedure TDexedMemo.ShowPhobosDoc;
var
str: string;
@ -2993,15 +2983,6 @@ begin
r := TStringRange.create(lines[i]);
while not r.empty do
begin
r.popWhile([' ', #9]);
if r.startsWith('//') then
r.popUntil(#0);
if r.startsWith('/*') then
begin
r.popFrontN(2);
r.popUntil('/');
r.popFront();
end;
w := r.popUntil(c)^.takeWhile(a).yield;
if (w.length >= fTextCompletionMinLength) and not h.contains(w) then
begin
@ -3022,11 +3003,6 @@ procedure TDexedMemo.completionCodeCompletion(var value: string;
begin
if KeyChar = '' then
exit;
if (KeyChar = '.') and (SourceValue <> value) then
begin
value := SourceValue + '.';
exit;
end;
if KeyChar[1] = ' ' then
value := sourceValue + KeyChar[1]
else
@ -3396,23 +3372,14 @@ begin
fIsDSource := Highlighter = fD2Highlighter;
end;
procedure TDexedMemo.setHighligthedIdent(value: string);
begin
if fHighlightedIdent = value then
exit;
fHighlightedIdent := value;
highlightCurrentIdentifier(false);
end;
procedure TDexedMemo.highlightCurrentIdentifier(fromEditor: boolean = true);
procedure TDexedMemo.highlightCurrentIdentifier;
var
s: string;
i: integer;
begin
if fromEditor then
fHighlightedIdent := GetWordAtRowCol(LogicalCaretXY);
if (fHighlightedIdent.length > 2) and (not SelAvail) then
SetHighlightSearch(fHighlightedIdent, fMatchIdentOpts)
fIdentifier := GetWordAtRowCol(LogicalCaretXY);
if (fIdentifier.length > 2) and (not SelAvail) then
SetHighlightSearch(fIdentifier, fMatchIdentOpts)
else if SelAvail and (BlockBegin.Y = BlockEnd.Y) then
begin
s := SelText;

View File

@ -18,31 +18,31 @@ inherited TodoListWidget: TTodoListWidget
Width = 576
Align = alClient
BorderSpacing.Around = 4
Columns = <
Columns = <
item
AutoSize = True
Caption = 'text'
Width = 36
end
end
item
AutoSize = True
Caption = 'category'
Width = 67
end
end
item
AutoSize = True
Caption = 'assignee'
Width = 68
end
end
item
AutoSize = True
Caption = 'status'
end
end
item
AutoSize = True
Caption = 'priority'
Width = 57
end
end
item
AutoSize = True
Caption = 'file'
@ -55,7 +55,6 @@ inherited TodoListWidget: TTodoListWidget
end
end
inherited toolbar: TDexedToolBar
Height = 30
Width = 576
OnResize = toolbarResize
object btnGo: TDexedToolButton[0]