Skip to content

Commit 1f940ca

Browse files
committed
bk/2024-09-24-2251
1 parent d34deeb commit 1f940ca

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

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

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,32 @@ procedure TDelphiAIDevIDENTAEditViewNotifier.BeforeSave;
8787

8888
end;
8989

90+
procedure TDelphiAIDevIDENTAEditViewNotifier.ClearLinesNotUsed;
91+
var
92+
LView: IOTAEditView;
93+
LColCurrent: Integer;
94+
LLineCurrent: Integer;
95+
begin
96+
////LVars.Release := False;
97+
if LVars.Module = nil then
98+
Exit;
99+
100+
//**
101+
if LVars.Contents.Count <= 1 then
102+
Exit;
103+
//**
104+
105+
LView := TUtilsOTA.GetIOTAEditView(LVars.Module);
106+
LColCurrent := LView.CursorPos.Col;
107+
LLineCurrent := LView.CursorPos.Line;
108+
try
109+
LView.Buffer.EditPosition.Move(LVars.LineIni, 2);
110+
LView.Buffer.EditPosition.Delete(Pred(LVars.Contents.Count));
111+
finally
112+
LView.Buffer.EditPosition.Move(LLineCurrent, LColCurrent);
113+
end;
114+
end;
115+
90116
procedure TDelphiAIDevIDENTAEditViewNotifier.BeginPaint(const View: IOTAEditView; var FullRepaint: Boolean);
91117
begin
92118
FullRepaint := True;
@@ -125,33 +151,6 @@ procedure TDelphiAIDevIDENTAEditViewNotifier.Modified;
125151

126152
end;
127153

128-
procedure TDelphiAIDevIDENTAEditViewNotifier.ClearLinesNotUsed;
129-
var
130-
LView: IOTAEditView;
131-
LColCurrent: Integer;
132-
LLineCurrent: Integer;
133-
begin
134-
////LVars.Release := False;
135-
136-
if LVars.Module = nil then
137-
Exit;
138-
139-
//**
140-
if LVars.Contents.Count <= 1 then
141-
Exit;
142-
//**
143-
144-
LView := TUtilsOTA.GetIOTAEditView(LVars.Module);
145-
LColCurrent := LView.CursorPos.Col;
146-
LLineCurrent := LView.CursorPos.Line;
147-
try
148-
LView.Buffer.EditPosition.Move(LVars.LineIni, 2);
149-
LView.Buffer.EditPosition.Delete(Pred(LVars.Contents.Count));
150-
finally
151-
LView.Buffer.EditPosition.Move(LLineCurrent, LColCurrent);
152-
end;
153-
end;
154-
155154
procedure TDelphiAIDevIDENTAEditViewNotifier.PaintLine(const View: IOTAEditView; LineNumber: Integer;
156155
const LineText: PAnsiChar; const TextWidth: Word; const LineAttributes: TOTAAttributeArray;
157156
const Canvas: TCanvas; const TextRect: TRect; const LineRect: TRect; const CellSize: TSize);
@@ -163,8 +162,8 @@ procedure TDelphiAIDevIDENTAEditViewNotifier.PaintLine(const View: IOTAEditView;
163162

164163
LLineText := string(LineText);
165164

166-
if not LLineText.Trim.IsEmpty then
167-
Exit;
165+
//AQUI VERIFICA SE A LINHA NAO FOR VAZIA NAO ADICIONA O TEXTO DA SUGESTAO
166+
//if not LLineText.Trim.IsEmpty then Exit;
168167

169168
//if LineNumber <> View.CursorPos.Line then Exit;
170169

@@ -177,7 +176,7 @@ procedure TDelphiAIDevIDENTAEditViewNotifier.PaintLine(const View: IOTAEditView;
177176
// end;
178177
// end;
179178

180-
if (LineNumber >= LVars.LineIni)and(LineNumber < LVars.LineEnd) then
179+
if (LineNumber >= LVars.LineIni) and (LineNumber < LVars.LineEnd) then
181180
begin
182181
Canvas.Brush.Style := bsClear;
183182
Canvas.Font.Color := $777777;

Src/KeyboardBinding/DelphiAIDev.KeyboardBinding.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ procedure TDelphiAIDevKeyboardBinding.BindKeyboard(const BindingServices: IOTAKe
9191
// Exit;
9292

9393
LShortcut := TConsts.CODE_COMPLETION_SHORTCUT_INVOKE;
94-
if not(Trim(TDelphiAIDevSettings.GetInstance.CodeCompletionShortcutInvoke).IsEmpty) then
94+
if not Trim(TDelphiAIDevSettings.GetInstance.CodeCompletionShortcutInvoke).IsEmpty then
9595
LShortcut := TDelphiAIDevSettings.GetInstance.CodeCompletionShortcutInvoke;
9696

9797
BindingServices.AddKeyBinding([TextToShortCut(LShortcut)], Self.CodeCompletionSearch, nil);

Src/Test/DelphiAIDev.Test.pas

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ TDelphiAIDevTest = class
2525
property Apelido: string read FApelido write FApelido;
2626
property Cep: Integer read FCep write FCep;
2727
procedure Clear;
28-
2928
end;
3029

3130
implementation

0 commit comments

Comments
 (0)