SynEdit: reduce compile warnings

This commit is contained in:
Martin 2025-03-01 12:38:27 +01:00
parent b50acfc112
commit 75bf0c3c01
13 changed files with 19 additions and 16 deletions

View File

@ -1322,7 +1322,7 @@ begin
if LastTextLine <> FirstTextLine then
ViewedRange := DisplayView.TextToViewIndex(LastTextLine);
rcInval.Bottom := Min(TextArea.TextBounds.Bottom,
TextArea.TextBounds.Top + (ViewedRange.Bottom + AScreenLineOffset
TextArea.TextBounds.Top + ({%H-}ViewedRange.Bottom + AScreenLineOffset
- TextArea.TopLine + 2) * TextArea.LineHeight);
end;
@ -1525,7 +1525,7 @@ begin
if LastTextLine <> FirstTextLine then
ViewedRange := DisplayView.TextToViewIndex(LastTextLine);
rcInval.Bottom := Min(TextBounds.Bottom,
TextBounds.Top + (ViewedRange.Bottom + AScreenLineOffset - TopLine + 2) * LineHeight);
TextBounds.Top + ({%H-}ViewedRange.Bottom + AScreenLineOffset - TopLine + 2) * LineHeight);
end;
{$IFDEF VerboseSynEditInvalidate}

View File

@ -1073,7 +1073,7 @@ begin
s := '';
if (BestLen >= 4) then
s := '[' + EncodeIntEx2(BestPos2 - BestPos) + EncodeIntEx2(BestLen)
s := '[' + EncodeIntEx2({%H-}BestPos2 - {%H-}BestPos) + EncodeIntEx2(BestLen)
else
if (BestLen = 3) and (BestPos2 - BestPos <= NumEncodeAsOneMax) then
s := ']' + EncodeIntEx2(BestPos2 - BestPos);

View File

@ -1189,7 +1189,7 @@ begin
end;
inherited SetLines(pValue);
if Enabled then begin
if (pValue <> old) then begin
if (pValue <> {%H-}old) then begin
// change:
if Assigned(pValue) then begin
// add Changehandler

View File

@ -3648,13 +3648,13 @@ begin
// *** END Check outerlines, for node that goes into visible area
// *** if found, then it is in DisableOpenEntry and DisabledCloseEntry
FirstEntryIdx := 0;
if ScanNodes then begin
// FAdjustedTop
NodeInfo := FIfDefTree.FindNodeAtPosition(FAdjustedTop, afmNext);
//while NodeInfo.HasNode and (NodeInfo.EntryCount = 0) do
// NodeInfo := NodeInfo.Successor;
Node := NodeInfo.Node;
FirstEntryIdx := 0;
if (Node <> nil) and (NodeInfo.StartLine < TopLine) then
FirstEntryIdx := Node.EntryCount - 1; // May be visible
end

View File

@ -344,7 +344,7 @@ begin
if (ALine = nil) or (not GetHasTabs(ALine)) then begin
// No tabs in ALine
assert(ALineIsTempText or (not StoredHasTab), 'TSynEditStringDynTabExpander.GetMinimumColumnWidths: ALineIsTempText or (not StoredHasTab)');
assert(ALineIsTempText or (not {%H-}StoredHasTab), 'TSynEditStringDynTabExpander.GetMinimumColumnWidths: ALineIsTempText or (not StoredHasTab)');
if (not ALineIsTempText) and (not HasStoredData) then
TabData.SetLineInfoUnknownEx(AnIndex, False);
exit;
@ -605,7 +605,7 @@ begin
CachedMergeTopIdx := Idx;
MergeMinColumnWidth(NewMergedMinColWidths, CurMinColWidths);
if CachedMergeBottomIdx - CachedMergeTopIdx >= MAX_MERGE then
if {%H-}CachedMergeBottomIdx - CachedMergeTopIdx >= MAX_MERGE then
SaveNewMergeCache;
end;
@ -625,6 +625,7 @@ begin
LineCnt := Count-1;
LastLineIdx := Result.FirstLineIdx + Length(Result.ColumnWidths)-1;
CachedMergeTopIdx := -1;
NewMergedMinColWidths := nil;
While (Idx <= LineCnt) do begin
inc(Idx);
if Idx > LineCnt then
@ -646,8 +647,6 @@ begin
break;
if CachedMergeTopIdx < 0 then begin
NewMergedMinColWidths := nil;
if (Idx > AnIndex) or
( Result.ContainsLine(Idx - 1) and Result.IsValidLine(Idx - 1) )
then begin

View File

@ -1466,7 +1466,9 @@ var
FirstViewedX: IntPos;
begin
if FWrapInfoForViewedXYProc <> nil then
WrapInfoForViewedXYProc(AViewedXY, AFlags, FirstViewedX, ALogPhysConvertor);
WrapInfoForViewedXYProc(AViewedXY, AFlags, FirstViewedX, ALogPhysConvertor)
else
FirstViewedX := 1;
inherited InternalGetInfoForViewedXY(AViewedXY, AFlags, AViewedXYInfo,
ALogPhysConvertor);

View File

@ -1276,7 +1276,7 @@ begin
PrevLineOffs := 0;
if (NextLineOffs > 0) and
( (PrevLineOffs = 0) or (PrevLineDist > NextLineDist) )
( (PrevLineOffs = 0) or ({%H-}PrevLineDist > {%H-}NextLineDist) )
then begin
MoveLinesAtEndTo(NextPage, 0, NextLineOffs);
Tree.FreeNode(Self);

View File

@ -343,7 +343,7 @@ begin
R.Bottom := R.Right;
NewImg;
DrawNodeSymbol(img.Canvas, R, cfFoldStart, []); // [-]
DrawNodeSymbol({%H-}img.Canvas, R, cfFoldStart, []); // [-]
FPopUpImageList.AddMasked(img, img.TransparentColor);
img.Free;

View File

@ -1572,7 +1572,7 @@ begin
end;
if Result then begin
if (TextLine < SynEdit.TopLine) or
if ({%H-}TextLine < SynEdit.TopLine) or
(TextLine > SynEdit.TopLine + SynEdit.LinesInWindow)
then
SynEdit.TopLine := Max(1, TextLine - SynEdit.LinesInWindow div 2);

View File

@ -1206,7 +1206,7 @@ begin
end;
if NewSearchPos <= 0 then
break; // Not in this line
SearchPos := NewSearchPos + Schemes[j].LastMatchLen;
SearchPos := NewSearchPos + Schemes[j{%H-}].LastMatchLen;
StartScheme(Schemes[j], Result, SearchPos, NewSearchPos);
end;
end;

View File

@ -5522,7 +5522,7 @@ begin
dec(FPasStartLevel);
end;
end
else if IsCollectingNodeInfo and (CollectingNodeInfoList.CountAll > i) then begin
else if IsCollectingNodeInfo and (CollectingNodeInfoList.CountAll > {%H-}i) then begin
nd := CollectingNodeInfoList.LastItemPointer;
exclude(nd^.FoldAction, sfaMarkup); // not markup able
nd^.LogXEnd := 0;

View File

@ -1244,7 +1244,7 @@ begin
end;
if (not edit) and
(CellAtPos >= 0) and (CellAtPos < Cells.Count) and
({%H-}CellAtPos >= 0) and (CellAtPos < Cells.Count) and
(CompareCarets(Pos, FCells[CellAtPos].LogStart) <= 0) and
(CompareCarets(Pos, FCells[CellAtPos].LogEnd) >= 0)
then begin

View File

@ -319,6 +319,7 @@ function TTestMarkupIfDef.TestTextNoIfDef: TStringArray;
Result[Length(Result)-1] := s;
end;
begin
Result := nil;
AddLine('//' );
AddLine('//' );
AddLine('//' );
@ -339,6 +340,7 @@ function TTestMarkupIfDef.TestTextIfDef: TStringArray;
end;
begin
Result := nil;
// 1
AddLine('//' );
AddLine('{$IFDEF a}' );