Skip to content

Commit f14c080

Browse files
committed
bk/2024-09-16-1501
1 parent 40a8ba2 commit f14c080

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

Src/AI/DelphiAIDev.AI.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ procedure TDelphiAIDevAI.ProcessSend(const AQuestion: string);
5656
LQuestion := TUtils.AdjustQuestionToJson(AQuestion);
5757
FResponse.Clear;
5858

59-
if TUtils.InDebugMy then
59+
if TUtils.DebugMyIsOn then
6060
TUtils.AddLogDeleteFileFirst(LQuestion, 'DelphiAIDevAI_ProcessSend');
6161

6262
case FAiUse of

Src/IDE/NTAEditViewNotifier/DelphiAIDev.IDE.NTAEditViewNotifier.pas

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ procedure TDelphiAIDevIDENTAEditViewNotifier.EditorIdle(const View: IOTAEditView
9696
begin
9797
TUtilsOTA.GetCursorPosition(LRow, LColumn);
9898

99-
if (LRow <> LVars.Row) or (LColumn <> LVars.Column) then
100-
begin
101-
LVars.LineIni := 0;
102-
LVars.Clear;
103-
end;
99+
if LVars.LineIni > 0 then
100+
if (LRow <> LVars.Row) or (LColumn <> LVars.Column) then
101+
begin
102+
LVars.LineIni := 0;
103+
LVars.Clear;
104+
TUtils.AddLog('EditorIdle');
105+
end;
104106
end;
105107

106108
procedure TDelphiAIDevIDENTAEditViewNotifier.EndPaint(const View: IOTAEditView);
@@ -130,18 +132,23 @@ procedure TDelphiAIDevIDENTAEditViewNotifier.PaintLine(const View: IOTAEditView;
130132
//if LineNumber <> View.CursorPos.Line then
131133
// Exit;
132134

133-
if (LineNumber >= LVars.LineIni)and(LineNumber <= LVars.LineEnd) then
135+
if (LineNumber >= LVars.LineIni)and(LineNumber < LVars.LineEnd) then
134136
begin
135137
Canvas.Brush.Style := bsClear;
136-
Canvas.Font.Color := $777777; //$666666;
138+
Canvas.Font.Color := $777777;
137139
if TDelphiAIDevSettings.GetInstance.CodeCompletionSuggestionColorUse then
138140
Canvas.Font.Color := TDelphiAIDevSettings.GetInstance.CodeCompletionSuggestionColor;
139141

140142
try
141143
LLineText := LVars.Contents[LineNumber - LVars.LineIni];
142144
Canvas.TextOut(TextRect.Left, TextRect.Top, LLineText.TrimRight);
143145
except on E: Exception do
144-
TUtils.AddLog(E.Message);
146+
if TUtils.DebugMyIsOn then
147+
TUtils.AddLog('Exception in TDelphiAIDevIDENTAEditViewNotifier.PaintLine: ' + sLineBreak +
148+
'LineNumber: ' + LineNumber.ToString + sLineBreak +
149+
'LineIni: ' + LVars.LineIni.ToString + sLineBreak +
150+
'LineEnd: ' + LVars.LineEnd.ToString + sLineBreak +
151+
E.Message);
145152
end;
146153
end;
147154
end;

Src/Utils/DelphiAIDev.Utils.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TUtils = class
3636
class procedure DriverIDFillItemsTStrings(AStrings: TStrings);
3737
class procedure DefaultsQuestionsKindFillItemsTStrings(AStrings: TStrings);
3838
class function AdjustQuestionToJson(const AValue: string): string;
39-
class function InDebugMy: Boolean;
39+
class function DebugMyIsOn: Boolean;
4040
class procedure AddLog(const AMessage: string);
4141
class procedure AddLogDeleteFileFirst(const AMessage: string; const ANameFile: string);
4242
class procedure AddLogInFileTxt(const AMessage: string; const ANameFile: string; ADeleteFileFirst: Boolean = False);
@@ -213,7 +213,7 @@ class function TUtils.AdjustQuestionToJson(const AValue: string): string;
213213
Result := Result.Replace('\\"', '\"', [rfReplaceAll, rfIgnoreCase]);
214214
end;
215215

216-
class function TUtils.InDebugMy: Boolean;
216+
class function TUtils.DebugMyIsOn: Boolean;
217217
begin
218218
Result := FileExists('C:\Temp\DelphiAIDev\DebugOn.c4d');
219219
end;

0 commit comments

Comments
 (0)