Menu

Double pasting in macro

2006-07-12
2012-11-13
  • Nobody/Anonymous

    Hi. Thanks for a great editor.
    I have one question.
    When I make a macro that selects all, pastes in the clipboard, selects all, join lines, selects all, copy.
    I get the entry twice.
    Why? Is this a bug?

     
    • Greg Bullock

      Greg Bullock - 2006-07-22

      This error occurs because the Paste command is recorded twice, once as a Scintilla notification in the function

      BOOL Notepad_plus::notify(SCNotification *notification)

      and again as a Windows menu command in the function

      void Notepad_plus::specialCmd(int id, int param)

      I believe the best solution is to remove it from the specialCmd function by replacing the line

                  case IDM_EDIT_PASTE:

      in that function's block for

          if (_recordingMacro)
              switch (id)
              {
                . . .
              }

      with the line

                  // case IDM_EDIT_PASTE: This one is already recorded as a Scintilla notification in notify(), so we don't need to also record it as Windows menu command.

      This is line 2920 in the file Notepad_plus.cpp in v3.7.

      Regards.
      Greg

       
      • Don HO

        Don HO - 2006-07-22

        Greg,

        Thank you for finding the bug.
        This line is commented and this bug will be fixed in v3.8 which will be released in a few hours.

        Don

         
    • Nobody/Anonymous

      I have a similar behaviour also. It act as if the Macro record is not turned off, for me. v3.7

      WinXPSP2, Pretty Vanilla install.
      Audacity, Filezilla,Firefox, Maxthon,Adaware, Spybot, CwShredder,CClean,Hijackthis, Spywareblaster, Symantec Corp Antivirus,Winamp v2.95, VLC,Media Player Classic, Tiny PDF Reader, GAIM for Windows with GTK, Java 1.4.2, and 7-Zip.

       
    • Greg Bullock

      Greg Bullock - 2006-07-18

      I'll try to look into this, but it will take me a few days (assuming I can get to it at all).

      Regards.
      Greg