mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 20:39:09 +02:00
fixed synedit invalidating partially visible line and selection from bottom to top
git-svn-id: trunk@8859 -
This commit is contained in:
parent
37aefb94f2
commit
390e6599a0
@ -1189,7 +1189,7 @@ end;
|
|||||||
function TCustomSynEdit.RowToScreenRow(PhysicalRow: integer): integer;
|
function TCustomSynEdit.RowToScreenRow(PhysicalRow: integer): integer;
|
||||||
// returns -1 for lines above visible screen (<TopLine)
|
// returns -1 for lines above visible screen (<TopLine)
|
||||||
// 0 for the first line
|
// 0 for the first line
|
||||||
// Max(1,LinesInWindow)-1 for the last
|
// Max(0,LinesInWindow-1) for the last fully visible line
|
||||||
// and returns LinesInWindow for lines below visible screen including the
|
// and returns LinesInWindow for lines below visible screen including the
|
||||||
// partially visible line at the bottom
|
// partially visible line at the bottom
|
||||||
var
|
var
|
||||||
@ -2041,7 +2041,7 @@ begin
|
|||||||
fTextHeight * {$IFDEF SYN_LAZARUS}RowToScreenRow(FirstLine)
|
fTextHeight * {$IFDEF SYN_LAZARUS}RowToScreenRow(FirstLine)
|
||||||
{$ELSE}(FirstLine - TopLine){$ENDIF},
|
{$ELSE}(FirstLine - TopLine){$ENDIF},
|
||||||
ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF},
|
ClientWidth{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF},
|
||||||
fTextHeight * {$IFDEF SYN_LAZARUS}RowToScreenRow(LastLine+1)
|
fTextHeight * {$IFDEF SYN_LAZARUS}(RowToScreenRow(LastLine)+1)
|
||||||
{$ELSE}(LastLine - TopLine + 1){$ENDIF});
|
{$ELSE}(LastLine - TopLine + 1){$ENDIF});
|
||||||
if sfLinesChanging in fStateFlags then
|
if sfLinesChanging in fStateFlags then
|
||||||
UnionRect(fInvalidateRect, fInvalidateRect, rcInval)
|
UnionRect(fInvalidateRect, fInvalidateRect, rcInval)
|
||||||
@ -5417,12 +5417,24 @@ var
|
|||||||
CaretXY := CaretXY;
|
CaretXY := CaretXY;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
BH: TPoint;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
Lines.BeginUpdate;
|
Lines.BeginUpdate;
|
||||||
try
|
try
|
||||||
BB := BlockBegin;
|
BB := BlockBegin;
|
||||||
BE := BlockEnd;
|
BE := BlockEnd;
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
// make sure, BB is lower than BE
|
||||||
|
if CompareCarets(BB,BE)<0 then begin
|
||||||
|
BH:=BB;
|
||||||
|
BB:=BE;
|
||||||
|
BE:=BH;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
if SelAvail then
|
if SelAvail then
|
||||||
DeleteSelection;
|
DeleteSelection;
|
||||||
if (Value <> nil) and (Value[0] <> #0) then
|
if (Value <> nil) and (Value[0] <> #0) then
|
||||||
|
@ -237,8 +237,6 @@ var
|
|||||||
DFMFilename: String;
|
DFMFilename: String;
|
||||||
LazarusUnitFilename: String;
|
LazarusUnitFilename: String;
|
||||||
LRSFilename: String;
|
LRSFilename: String;
|
||||||
ActiveSrcEdit: TSourceEditorInterface;
|
|
||||||
ActiveUnitInfo: TUnitInfo;
|
|
||||||
UnitCode, LFMCode: TCodeBuffer;
|
UnitCode, LFMCode: TCodeBuffer;
|
||||||
HasDFMFile: boolean;
|
HasDFMFile: boolean;
|
||||||
LFMFilename: String;
|
LFMFilename: String;
|
||||||
|
Loading…
Reference in New Issue
Block a user