Skip to content

Commit

Permalink
Replace STYLE_AUTOCOMPLETION and SCI_AUTOCUSESTYLE with SCI_AUTOCSETS…
Browse files Browse the repository at this point in the history
…TYLEOFFSET (and SCI_AUTOCGETSTYLEOFFSET).
  • Loading branch information
martijnlaan committed Jun 22, 2024
1 parent f80f1db commit 9872717
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
23 changes: 15 additions & 8 deletions Components/ScintEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ TScintEdit = class(TWinControl)
FAcceptDroppedFiles: Boolean;
FAutoCompleteFontName: String;
FAutoCompleteFontSize: Integer;
FAutoCompleteStyleOffset: Integer;
FChangeHistory: TScintChangeHistory;
FCodePage: Integer;
FDirectPtr: Pointer;
Expand Down Expand Up @@ -2140,15 +2141,21 @@ procedure TScintEdit.UpdateStyleAttributes;
SetStyleAttrFromStyler(STYLE_LINENUMBER);
end;

if AutoCompleteFontName <> '' then
DefaultAttr.FontName := AutoCompleteFontName;
if AutoCompleteFontSize > 0 then
if (AutoCompleteFontName <> '') or (AutoCompleteFontSize > 0) then begin
if AutoCompleteFontName <> '' then
DefaultAttr.FontName := AutoCompleteFontName;
if AutoCompleteFontSize > 0 then
DefaultAttr.FontSize := AutoCompleteFontSize;
DefaultAttr.FontStyle := [];
{ Note: Scintilla doesn't actually use the colors set here }
DefaultAttr.ForeColor := clWindowText;
DefaultAttr.BackColor := clWindow;
SetStyleAttr(STYLE_AUTOCOMPLETION, DefaultAttr, True);
DefaultAttr.FontStyle := [];
{ Note: Scintilla doesn't actually use the colors set here }
DefaultAttr.ForeColor := clWindowText;
DefaultAttr.BackColor := clWindow;
if FAutoCompleteStyleOffset = 0 then
FAutoCompleteStyleOffset := Call(SCI_ALLOCATEEXTENDEDSTYLES, 1, 0);
SetStyleAttr(STYLE_DEFAULT + FAutoCompleteStyleOffset, DefaultAttr, True);
Call(SCI_AUTOCSETSTYLEOFFSET, FAutoCompleteStyleOffset, 0);
end else
Call(SCI_AUTOCSETSTYLEOFFSET, 0, 0);
end;

function TScintEdit.WordAtCursor: String;
Expand Down
Binary file modified Files/isscint.dll
Binary file not shown.
1 change: 0 additions & 1 deletion Projects/Src/CompScintEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ procedure TCompScintEdit.CreateWnd;
Call(SCI_AUTOCSETIGNORECASE, 1, 0);
Call(SCI_AUTOCSETMAXHEIGHT, 12, 0);
Call(SCI_AUTOCSETMULTI, SC_MULTIAUTOC_EACH, 0);
Call(SCI_AUTOCUSESTYLE, 0, 0);

Call(SCI_SETMULTIPLESELECTION, 1, 0);
Call(SCI_SETADDITIONALSELECTIONTYPING, 1, 0);
Expand Down
5 changes: 2 additions & 3 deletions Projects/Src/IsscintInt.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ interface

const
SC_MARK_BACKFORE = 34;
STYLE_AUTOCOMPLETION = 40;
STYLE_LASTPREDEFINED = 40;
SCI_CUTALLOWLINE = 2805;
SCI_AUTOCUSESTYLE = 2806;
SCI_AUTOCSETSTYLEOFFSET = 2806;
SCI_AUTOGSETSTYLEOFFSET = 2807;
SC_MASK_HISTORY = $01E00000;

implementation
Expand Down

0 comments on commit 9872717

Please sign in to comment.