View Issue Details

IDProjectCategoryView StatusLast Update
0024663FPCTextmode IDEpublic2019-01-01 17:04
ReporterLibra07Assigned ToFlorian 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWin32OSXP, Vista, Win7OS Versionall
Product Version2.6.2Product Build 
Target VersionFixed in Version3.3.1 
Summary0024663: Error on Undo function - Duplicate rows
DescriptionThe FreePascal 2.6.2 Win32 Textmode IDE and previous versions has an error when I edit the source code. When i use the DEL or BACKSPACE buttons and one row goes up to the end of the previous row, then the UNDO function generates duplicated rows.
Steps To Reproduce1. Go to end of a row
2. Press "DEL" button
3. The next row will go up to the end of this row
3. Run EDIT-UNDO on the menu or press ALT+BACKSPACE buttons
4. Duplicated rows!!!

...or...

1. Go to first character of a row
2. Press "BACKSPACE" button
3. This row will go up to the end of the previous
3. Run EDIT-UUNDO on the menu or press ALT+BACKSPACE buttons
4. Duplicated rows!!!
TagsNo tags attached.
Fixed in Revision40730
FPCOldBugId
FPCTarget
Attached Files
  • FPC_Undo_Error_3.PNG (47,585 bytes)
    FPC_Undo_Error_3.PNG (47,585 bytes)
  • delLine.patch (1,021 bytes)
    Index: packages/ide/wcedit.pas
    ===================================================================
    --- packages/ide/wcedit.pas	(revision 40610)
    +++ packages/ide/wcedit.pas	(working copy)
    @@ -1386,13 +1386,14 @@
                     WasInserting:=GetInsertMode;
                     SetInsertMode(true);
                     SetFlags(GetFlags or efNoIndent);
    -                InsertLine(StartPos.Y,'');
    +                InsertLine(StartPos.Y,GetStr(Text));
                     SetInsertMode(WasInserting);
                     if not HadefNoIndent then
                       SetFlags(GetFlags and not efNoIndent);
                     {DelEnd; wrong for eaCut at least }
                     SetCurPtr(StartPos.X,StartPos.Y);
    -                SetLineText(StartPos.Y,Copy(GetDisplayText(StartPos.Y),1,StartPos.X)+GetStr(Text));
    +                if StartPos.Y > EndPos.Y then
    +                   SetLineText(EndPos.Y,Copy(GetDisplayText(EndPos.Y),1,EndPos.X));
                     SetMinMax(StartPos.Y);
                   end;
                 eaSelectionChanged :
    delLine.patch (1,021 bytes)

Relationships

duplicate of 0034720 closedMarco van de Voort Undo DelLine leave extra copy of line that was delete 

Activities

Libra07

2013-06-26 10:09

reporter  

FPC_Undo_Error_3.PNG (47,585 bytes)
FPC_Undo_Error_3.PNG (47,585 bytes)

Marģers

2018-12-30 21:18

reporter  

delLine.patch (1,021 bytes)
Index: packages/ide/wcedit.pas
===================================================================
--- packages/ide/wcedit.pas	(revision 40610)
+++ packages/ide/wcedit.pas	(working copy)
@@ -1386,13 +1386,14 @@
                 WasInserting:=GetInsertMode;
                 SetInsertMode(true);
                 SetFlags(GetFlags or efNoIndent);
-                InsertLine(StartPos.Y,'');
+                InsertLine(StartPos.Y,GetStr(Text));
                 SetInsertMode(WasInserting);
                 if not HadefNoIndent then
                   SetFlags(GetFlags and not efNoIndent);
                 {DelEnd; wrong for eaCut at least }
                 SetCurPtr(StartPos.X,StartPos.Y);
-                SetLineText(StartPos.Y,Copy(GetDisplayText(StartPos.Y),1,StartPos.X)+GetStr(Text));
+                if StartPos.Y > EndPos.Y then
+                   SetLineText(EndPos.Y,Copy(GetDisplayText(EndPos.Y),1,EndPos.X));
                 SetMinMax(StartPos.Y);
               end;
             eaSelectionChanged :
delLine.patch (1,021 bytes)

Marģers

2018-12-30 21:20

reporter   ~0113023

patch added

Florian

2019-01-01 17:04

administrator   ~0113063

Thank you, patch applied.

Issue History

Date Modified Username Field Change
2013-06-26 10:09 Libra07 New Issue
2013-06-26 10:09 Libra07 File Added: FPC_Undo_Error_3.PNG
2018-12-24 22:30 Marco van de Voort Relationship added duplicate of 0034720
2018-12-30 21:18 Marģers File Added: delLine.patch
2018-12-30 21:20 Marģers Note Added: 0113023
2019-01-01 17:04 Florian Fixed in Revision => 40730
2019-01-01 17:04 Florian Note Added: 0113063
2019-01-01 17:04 Florian Status new => resolved
2019-01-01 17:04 Florian Fixed in Version => 3.3.1
2019-01-01 17:04 Florian Resolution open => fixed
2019-01-01 17:04 Florian Assigned To => Florian