mirror of https://gitlab.com/basile.b/dexed.git
minor changes to todo list tool and front end
This commit is contained in:
parent
c407a40259
commit
30d2d7b8f5
|
@ -148,12 +148,12 @@ void main(string[] args)
|
||||||
|
|
||||||
// efficient appending if the item text ~ fields is about 100 chars
|
// efficient appending if the item text ~ fields is about 100 chars
|
||||||
lfmApp.reserve(todoItems.length * 128 + 64);
|
lfmApp.reserve(todoItems.length * 128 + 64);
|
||||||
|
|
||||||
// serialize the items using the pascal component streaming text format
|
// serialize the items using the pascal component streaming text format
|
||||||
lfmApp.put("object TTodoItems\r items = <");
|
lfmApp.put("object TTodoItems\r items = <");
|
||||||
foreach(todoItem; todoItems) todoItem.serialize(lfmApp);
|
foreach(todoItem; todoItems) todoItem.serialize(lfmApp);
|
||||||
lfmApp.put(">\rend\r\n");
|
lfmApp.put(">\rend\r\n");
|
||||||
|
|
||||||
// the widget has the LFM script in the output
|
// the widget has the LFM script in the output
|
||||||
write(lfmApp.data);
|
write(lfmApp.data);
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ void main(string[] args)
|
||||||
{
|
{
|
||||||
identifier ~= std.ascii.toUpper(text.front);
|
identifier ~= std.ascii.toUpper(text.front);
|
||||||
text.popFront;
|
text.popFront;
|
||||||
if (canFind(["TODO","FIXME"], identifier))
|
if (identifier.among("TODO","FIXME"))
|
||||||
{
|
{
|
||||||
isTodoComment = true;
|
isTodoComment = true;
|
||||||
break;
|
break;
|
||||||
|
@ -213,7 +213,7 @@ void main(string[] args)
|
||||||
if (front == ':')
|
if (front == ':')
|
||||||
{
|
{
|
||||||
if (identifier.length) fields = identifier;
|
if (identifier.length) fields = identifier;
|
||||||
isWellFormed = (text.length > 0);
|
isWellFormed = text.length > 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,24 +223,27 @@ void main(string[] args)
|
||||||
|
|
||||||
// parses the item description fields
|
// parses the item description fields
|
||||||
string a, c, p, s;
|
string a, c, p, s;
|
||||||
if (fields.length) while (!fields.empty)
|
while (!fields.empty)
|
||||||
{
|
{
|
||||||
auto front = fields.front;
|
dchar front = fields.front;
|
||||||
fields.popFront;
|
fields.popFront;
|
||||||
if ((front == '-' || fields.empty) && identifier.length > 2)
|
if ((front == '-' || fields.empty) && identifier.length > 2)
|
||||||
{
|
{
|
||||||
auto field0 = identifier[0..2].toUpper;
|
string fieldContent = identifier[2..$].strip;
|
||||||
auto field1 = identifier[2..$].strip;
|
switch(identifier[0..2].toUpper)
|
||||||
if (field0 == "-A") a = field1;
|
{
|
||||||
else if (field0 == "-C") c = field1;
|
default: break;
|
||||||
else if (field0 == "-P") p = field1;
|
case "-A": a = fieldContent; break;
|
||||||
else if (field0 == "-S") s = field1;
|
case "-C": c = fieldContent; break;
|
||||||
identifier = "";
|
case "-P": p = fieldContent; break;
|
||||||
|
case "-S": s = fieldContent; break;
|
||||||
|
}
|
||||||
|
identifier = "";
|
||||||
}
|
}
|
||||||
identifier ~= front;
|
identifier ~= front;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
try line = to!string(atok.line);
|
try line = to!string(atok.line);
|
||||||
catch(ConvException e) line = "0";
|
catch(ConvException e) line = "0";
|
||||||
|
|
|
@ -2177,6 +2177,7 @@ begin
|
||||||
begin
|
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
|
||||||
if TForm(widg.Parent).Visible then if not onTop then
|
if TForm(widg.Parent).Visible then if not onTop then
|
||||||
TForm(widg.Parent).SendToBack;
|
TForm(widg.Parent).SendToBack;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -404,6 +404,7 @@ end;
|
||||||
procedure TCETodoListWidget.callToolProcess;
|
procedure TCETodoListWidget.callToolProcess;
|
||||||
var
|
var
|
||||||
ctxt: TTodoContext;
|
ctxt: TTodoContext;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
clearTodoList;
|
clearTodoList;
|
||||||
if not exeInSysPath(ToolExeName) then
|
if not exeInSysPath(ToolExeName) then
|
||||||
|
@ -423,9 +424,11 @@ begin
|
||||||
|
|
||||||
// files passed to the tool argument
|
// files passed to the tool argument
|
||||||
if ctxt = tcProject then
|
if ctxt = tcProject then
|
||||||
fToolProc.Parameters.AddText(symbolExpander.get('<CPFS>'))
|
begin
|
||||||
else
|
for i := 0 to fProj.sourcesCount-1 do
|
||||||
fToolProc.Parameters.Add(symbolExpander.get('<CFF>'));
|
fToolProc.Parameters.Add(fProj.sourceAbsolute(i));
|
||||||
|
end
|
||||||
|
else fToolProc.Parameters.Add(fDoc.fileName);
|
||||||
//
|
//
|
||||||
fToolProc.Execute;
|
fToolProc.Execute;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue