SynEdit: fixed crash, with ecDeleteLine on last line. issue #0020299

git-svn-id: trunk@32424 -
This commit is contained in:
martin 2011-09-19 18:42:31 +00:00
parent 37fa512845
commit 4687ef5cc0

View File

@ -1941,6 +1941,8 @@ begin
EnsureCursorPosVisible; // TODO: This may call SetTopLine, change order
// This does Paintlock, should be before final decrease
// Must be after EnsureCursorPosVisible (as it does MoveCaretToVisibleArea)
if FCaret.LinePos > FLines.Count then
FCaret.LinePos := FLines.Count;
if sfCaretChanged in fStateFlags then
UpdateCaret;
//if sfScrollbarChanged in fStateFlags then
@ -4929,6 +4931,7 @@ begin
ScanRanges;
InvalidateLines(AIndex + 1, -1);
InvalidateGutterLines(AIndex + 1, -1);
if FCaret.LinePos > FLines.Count then FCaret.LinePos := FLines.Count;
end;
if TopLine > AIndex + 1 then
TopLine := TopLine + ACount // will call UpdateScrollBars