Issure 2: Copy & Paste issue between Unites

Issue 2: Copy & Past issue between Unites.

There is a problem with copying any text to the Clipboard and then pasting it to a Unit file. When you paste the text to a Unit. The text is not added to the unit at the current cursor location. Instead it is added to the beginning of the unit.

I did notice that someone had reported the issue once before. And that you had stated that it was fixed. But with my clean install of Scripter v7.22, and a clean build of IDE Demo, the problem still exists.

To make it easier to reproduce:

  1. Launch IDE Demo.
  2. Copy the following code to Unit1.
  3. Select the Unit2 tab.
  4. Select the Code tab.
  5. Goto the end of line 6 and press the Enter key. (Causing the cursor to now be on Line 7 which is empty.
  6. Select the Unit1 tab.
  7. Select Lines 13 thru 17.
  8. Press CTRL+C
  9. Select Unit2 (The cursor should still be on line 7, which is still empty.)
  10. Press CTRL+V
  11. And the six lines that you pasted to Unit2 is added to the beginning of the Unit. And not at Line 7.

In my testing It seems that once TIDEMemo losses focus from the current Unit file, to another Unit file. (And in some rare cases, when IDE Demo loses focus to another application.) And then when you return to that Unit file. TIDEMemo loses track of where the cursor is. And just adds any text from the clipboard during the paste to the beginning of the Unit.

Test Code for Unit1:

uses
  Classes, Graphics, Controls, Forms, Dialogs,
  SysUtils, Unit2;

var
  MainForm: TForm2;
  i;
begin
  Application.ProcessMessages;
  MainForm := TForm2.Create(Application);
  try    
    MainForm.Show;
    for i := 1 to 60 do
    begin 
      Application.ProcessMessages;
      Sleep(100);
    end;
  finally
    MainForm.FreeOnRelease;
  end;
end;

Thank you for the detailed report. We are able to reproduce and are investigating the issue.

We have fixed this issue internally, next update will have the fix included.