Python Script - Undo problem

slimeph
2013-12-19
2013-12-20
  • slimeph
    slimeph
    2013-12-19

    After installing Python Script, undo-ing an action reverts all of the
    contents to the previous contents not the undo state.

    Steps to reproduce:
    1) If the current buffer has text, paste anything.
    2) Run the script. Script contents below:
    editor.replace("-mail", "mail")
    3) Process anything in the current buffer.
    4) Press CTRL-Z. Contents will then revert to the the text before the
    script ran.

    Win 7 Ultimate 64-Bit
    Notepad++ 6.4.5 (Unicode)

     
    Attachments
    • ERROR! The markdown supplied could not be parsed correctly. Did you forget to surround a code snippet with "~~~~"?

      Yes, I'm working on a new replace method that fixes many of the old issues.
      As an ugly workaround, do a editor.endUndoAction() after doing a replace()
      
      Dave
      On 19 Dec 2013 17:07, "slimeph" <slimeph@users.sf.net> wrote:
      
      > After installing Python Script, undo-ing an action reverts all of the
      > contents to the previous contents not the undo state.
      >
      > Steps to reproduce:
      > 1) If the current buffer has text, paste anything.
      > 2) Run the script. Script contents below:
      > editor.replace("-mail", "mail")
      > 3) Process anything in the current buffer.
      > 4) Press CTRL-Z. Contents will then revert to the the text before the
      > script ran.
      >
      > Win 7 Ultimate 64-Bit
      > Notepad++ 6.4.5 (Unicode)
      >
      >
      >
      > ---
      >
      > [Python Script - Undo problem](
      > http://sourceforge.net/p/notepad-plus/discussion/1290590/thread/e64347cf/?limit=25#0226
      > )
      >
      >
      > ---
      >
      > Sent from sourceforge.net because you indicated interest in <
      > https://sourceforge.net/p/notepad-plus/discussion/1290590/>
      >
      > To unsubscribe from further messages, please visit <
      > https://sourceforge.net/auth/subscriptions/>
      >
      
       
      Attachments
      • slimeph
        slimeph
        2013-12-19

        Thanks for the prompt reply.

        I've got a series of replace. Do I place it after every line? -- now checking it myself. :)

         
        Last edit: slimeph 2013-12-19
        • Sadly yes. It doesn't close the undo action properly, so you have to do it
          yourself.