Skip to content

Commit 3932513

Browse files
Robert Di PardoRobert Di Pardo
authored andcommitted
Remove calls to obsolete style byte APIs
Per https://www.scintilla.org/ScintillaDoc.html#SCI_GETSTYLEBITS > The last [Scintilla] version to support style byte indicators was 3.4.2. > Any use of these symbols should be removed and replaced with standard > indicators: https://www.scintilla.org/ScintillaDoc.html#Indicators
1 parent cffe269 commit 3932513

3 files changed

Lines changed: 6 additions & 34 deletions

File tree

src/LibNppPlugin/NppSimpleObjects.pas

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ TTextRange = class
5858

5959
procedure Select();
6060
procedure Indent(const Levels: integer = 1);
61-
procedure Mark(const Style: integer; const Mask: integer = 0; const DurationInMs: cardinal = 0);
61+
procedure Mark(const Style: integer; const DurationInMs: cardinal = 0);
6262

6363
property Document: TActiveDocument read FEditor;
6464
property StartPos: Sci_Position read FStartPos write SetStart;
@@ -451,30 +451,14 @@ procedure TTextRange.Indent(const Levels: integer);
451451

452452
{ ------------------------------------------------------------------------------------------------ }
453453

454-
procedure TTextRange.Mark(const Style, Mask: integer; const DurationInMs: cardinal);
454+
procedure TTextRange.Mark(const Style: integer; const DurationInMs: cardinal);
455455
var
456456
CurrentStyleEnd: Sci_Position;
457-
StyleBits: integer;
458457
begin
459458
CurrentStyleEnd := FEditor.SendMessage(SCI_GETENDSTYLED);
460-
{
461-
Per https://www.scintilla.org/ScintillaDoc.html#SCI_GETSTYLEBITS:
462-
463-
"The following are features that should be removed from calling code but are
464-
still defined to avoid breaking callers.
465-
466-
"Scintilla no longer supports style byte indicators. The last version to
467-
support style byte indicators was 3.4.2. Any use of these symbols should be
468-
removed and replaced with standard indicators <https://www.scintilla.org/ScintillaDoc.html#Indicators>"
469-
}
470-
StyleBits := FEditor.SendMessage(SCI_GETSTYLEBITS);
471-
if Mask = 0 then begin
472-
FEditor.SendMessage(SCI_STARTSTYLING, FStartPos, StyleBits);
473-
end else begin
474-
FEditor.SendMessage(SCI_STARTSTYLING, FStartPos, Mask);
475-
end;
459+
FEditor.SendMessage(SCI_STARTSTYLING, FStartPos, 0);
476460
FEditor.SendMessage(SCI_SETSTYLING, GetLength, Style);
477-
FEditor.SendMessage(SCI_STARTSTYLING, CurrentStyleEnd, StyleBits);
461+
FEditor.SendMessage(SCI_STARTSTYLING, CurrentStyleEnd, 0);
478462

479463
if DurationInMs > 0 then
480464
TimedTextRangeMarks.Add(TTextRangeMark.Create(Self, DurationInMs));
@@ -1103,7 +1087,7 @@ destructor TTextRangeMark.Destroy;
11031087
CurrentStyleEnd := Editor.SendMessage(SCI_GETENDSTYLED);
11041088
if FStartPos < CurrentStyleEnd then
11051089
CurrentStyleEnd := FStartPos;
1106-
Editor.SendMessage(SCI_STARTSTYLING, CurrentStyleEnd, Editor.SendMessage(SCI_GETSTYLEBITS));
1090+
Editor.SendMessage(SCI_STARTSTYLING, CurrentStyleEnd, 0);
11071091
except
11081092
on E: Exception do begin
11091093
// ignore

src/U_HTMLTagFinder.pas

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -338,22 +338,12 @@ procedure FindMatchingTag(ASelect: boolean = False; AContentsOnly: Boolean = Fal
338338
end;
339339
end else begin
340340
MatchingTag.Select;
341-
{$IFNDEF NPPUNICODE} // NPP Unicode has always done this itself
342-
if HIWORD(npp.SendMessage(NPPM_GETNPPVERSION)) < 5 then begin
343-
Tag.Mark(STYLE_BRACELIGHT, 255, ncHighlightTimeout);
344-
MatchingTag.Mark(STYLE_BRACELIGHT, 255, ncHighlightTimeout);
345-
end;
346-
{$ENDIF}
347341
end;
348342
end else begin
349343
if ASelect then begin
350344
MatchingTag.Select;
351345
end else begin
352346
MatchingTag.Select;
353-
{$IFNDEF NPPUNICODE} // NPP Unicode has always done this itself
354-
if HIWORD(npp.SendMessage(NPPM_GETNPPVERSION)) < 5 then
355-
MatchingTag.Mark(STYLE_BRACELIGHT, 255, ncHighlightTimeout);
356-
{$ENDIF}
357347
end;
358348
end;
359349
end else if Tags.Count > 0 then begin
@@ -362,7 +352,7 @@ procedure FindMatchingTag(ASelect: boolean = False; AContentsOnly: Boolean = Fal
362352
if ASelect then begin
363353
Tag.Select;
364354
end;
365-
Tag.Mark(STYLE_BRACEBAD, 255, ncHighlightTimeout);
355+
Tag.Mark(STYLE_BRACEBAD, ncHighlightTimeout);
366356
end else begin
367357
MessageBeep(MB_ICONWARNING);
368358
end;

src/prj/HTMLTag.lpi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
<CustomOptions Value="-dUNICODE
7272
-dNPPUNICODE
7373
-dSCI_DISABLE_PROVISIONAL
74-
-dINCLUDE_DEPRECATED_FEATURES
7574
-FcUTF8
7675
-vm2026,4104,5024"/>
7776
<OtherDefines Count="2">
@@ -181,7 +180,6 @@
181180
-dNPPUNICODE
182181
-FcUTF8
183182
-dSCI_DISABLE_PROVISIONAL
184-
-dINCLUDE_DEPRECATED_FEATURES
185183
-WN
186184
-vm2026"/>
187185
</Other>

0 commit comments

Comments
 (0)