Community
    • Login

    Suggestions: Undo history and enlarged search history

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 351 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ariel AbecasisA
      Ariel Abecasis
      last edited by

      1. It would be useful to be able to right-click the Undo button, see all the history of recent operations and be able to revert to any point in that history, as is the case in many other applications (and same with Redo, obviously).
      2. It would also be great to be able to customize the size of the Search history, I’d like it to be much longer so that complex RegEx searches wouldn’t disappear so fast.
      PeterJonesP 1 Reply Last reply Reply Quote 1
      • PeterJonesP
        PeterJones @Ariel Abecasis
        last edited by

        @Ariel-Abecasis ,

        1. In a recent topic, there was a script for the PythonScript plugin that detailed the edit history for a particular file. If you were willing to put in effort, you could start with that script, and then expand it to do something (undo and redo) with that history, rather than just displaying it. And if he was interested, @Mark-Olson might even tweak it in that direction, since he seemed interested in that original idea.

        2. You already can customize the search-history length using the config file, as described in the user manual’s “advanced preferences” section – it can be set anywhere up to 30 (the author felt that was enough for any reasonable need, and was unwilling to push it beyond that limit).

        1 Reply Last reply Reply Quote 0
        • Mark OlsonM
          Mark Olson
          last edited by Mark Olson

          So I did a bit of digging related to this topic, and it looks like binding a callback to SCN_MACRORECORD would allow you to record the history of changes in a way that treats a find/replace action as a single action rather than as a series of insertions and deletions of characters (which my modification log script currently does).

          The catch? SCN_MACRORECORD notifications only fire when a macro is being recorded. This means that any script that wanted to record find/replace actions would have to start recording a macro when it was first run, and it could not stop recording the macro until it stopped. This means that such a script would prevent you from using the macro recorder in a normal way.

          I don’t think it would be too difficult to implement such a script or plugin, but it’s important to understand the tradeoffs.

          EDIT: I tried using PythonScript to print SCN_MACRORECORD notifications (just a simple editor.callback(lambda notif: print(notif), [SCINTILLANOTIFICATION.MACRORECORD])), and I found that find/replace actions don’t trigger those notifications in PythonScript. This is obviously really weird, because find/replace actions are clearly macroable. So I’m not too sure that Ariel’s idea is really do-able, at least in PythonScript.

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors