Skip to content

Commit

Permalink
Improve auto complete automatically completing on non ident char typed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Aug 31, 2023
1 parent c7322ee commit bfecccf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Binary file added DocGen/images/dtm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions Source/editor/simba.editor_autocomplete.pas
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ constructor TSimbaAutoComplete_Form.Create(AOwner: TComponent);

procedure TSimbaAutoComplete.ContinueCompletion(Data: PtrInt);
begin
Editor.CommandProcessor(ecChar, Char(Byte(Data)), nil);
Editor.CommandProcessor(TSynEditorCommand(Data), #0, nil);
end;

procedure TSimbaAutoComplete.DoCodeCompletion(var Value: String; SourceValue: String; var SourceStart, SourceEnd: TPoint; KeyChar: TUTF8Char; Shift: TShiftState);
Expand All @@ -346,10 +346,11 @@ procedure TSimbaAutoComplete.DoCodeCompletion(var Value: String; SourceValue: St
Value := SourceValue
else
Value := Decl.Name;
Value := Value + KeyChar;

case KeyChar of
'.': Application.QueueAsyncCall(@ContinueCompletion, Ord('.'));
',': Application.QueueAsyncCall(@ContinueCompletion, Ord(','));
'.': Application.QueueAsyncCall(@ContinueCompletion, TSimbaEditor(Editor).AutoComplete.AutoCompleteCommand);
',','(': Application.QueueAsyncCall(@ContinueCompletion, TSimbaEditor(Editor).ParamHint.ParamHintCommand);
end;
end;

Expand Down
1 change: 1 addition & 0 deletions Source/forms/simba.functionlistform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function GetURL(const Section: String): String;
'Matrix': Result := 'https://villavu.github.io/Simba/Matrix.html';
'Misc': Result := 'https://villavu.github.io/Simba/Misc.html';
'Dialogs': Result := 'https://villavu.github.io/Simba/Dialogs.html';
'DTM': Result := 'https://villavu.github.io/Simba/DTM.html';
end;
end;

Expand Down
2 changes: 2 additions & 0 deletions Source/script/imports/simbaclasses/simba.import_class_dtm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ implementation
DTM
===
DTM related methods
Image:: ../images/dtm.png
*)

(*
Expand Down
4 changes: 2 additions & 2 deletions Source/simba.bitmap.pas
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ TSimbaImage = class(TSimbaBaseClass)
implementation

uses
BMPcomn,
BMPcomn, fpqoi_simba,
simba.overallocatearray, simba.geometry, simba.tpa, simba.datetime,
simba.encoding, simba.compress, simba.math,
simba.nativeinterface, simba.singlematrix, fpqoi_simba,
simba.nativeinterface, simba.singlematrix,
simba.image_lazbridge, simba.rgbsumtable;

function GetDistinctColor(const Color, Index: Integer): Integer; inline;
Expand Down

0 comments on commit bfecccf

Please sign in to comment.