|
From: Marko N. <mar...@us...> - 2004-08-22 20:05:04
|
Update of /cvsroot/synedit/SynEdit/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13077/Source Modified Files: SynEdit.pas Log Message: Fixed bug: [ 1013773 ] deleteline/redo bug Index: SynEdit.pas =================================================================== RCS file: /cvsroot/synedit/SynEdit/Source/SynEdit.pas,v retrieving revision 1.385 retrieving revision 1.386 diff -u -d -r1.385 -r1.386 --- SynEdit.pas 11 Aug 2004 17:56:06 -0000 1.385 +++ SynEdit.pas 22 Aug 2004 20:04:53 -0000 1.386 @@ -6642,7 +6642,7 @@ iUndoBegin, iUndoEnd: TBufferCoord; vCaretRow: integer; vNewCaretPos: TDisplayCoord; - vTabTrim: integer; + vTabTrim: integer; begin IncPaintLock; try @@ -7050,23 +7050,25 @@ DoOnPaintTransient(ttAfter); end; ecDeleteLine: - if not ReadOnly and (Lines.Count > 0) and not ((Lines.Count = 1) and (Length(Lines[0]) = 0)) + if not ReadOnly and (Lines.Count > 0) and not ((CaretY = Lines.Count) and (Length(Lines[CaretY - 1]) = 0)) then begin DoOnPaintTransient(ttBefore); if SelAvail then SetBlockBegin(CaretXY); Helper := LineText; - if Lines.Count = 1 then - Lines[0] := '' + if CaretY = Lines.Count then + begin + Lines[CaretY - 1] := ''; + fUndoList.AddChange(crSilentDeleteAfterCursor, BufferCoord(1, CaretY), + BufferCoord(Length(Helper) + 1, CaretY), Helper, smNormal); + end else begin Lines.Delete(CaretY - 1); - //Repair problem with deleting last line and UndoIt - if CaretY <= fLines.Count then - Helper := Helper + #13#10; + Helper := Helper + #13#10; + fUndoList.AddChange(crSilentDeleteAfterCursor, BufferCoord(1, CaretY), + BufferCoord(1, CaretY + 1), Helper, smNormal); + DoLinesDeleted(CaretY - 1, 1); end; - fUndoList.AddChange(crSilentDeleteAfterCursor, BufferCoord(1, CaretY), - CaretXY, Helper, smNormal); - DoLinesDeleted(CaretY - 1, 1); InternalCaretXY := BufferCoord(1, CaretY); // like seen in the Delphi editor end; ecClearAll: |