Community
    • Login

    Differentiate user pressing Backspace vs Find and Replace action

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    2 Posts 2 Posters 712 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.
    • p0358P
      p0358
      last edited by

      Hey, as in topic, is it possible? I currently detect backspace presses (deleting text) with SCN_MODIFIED and checking for flags SC_PERFORMED_USER & SC_MOD_DELETETEXT, but it appears the exact same notifications with exact same flags is dispatched when using Find and Replace function, which slows the replacement action down.
      My plugin is Code::Stats, it should add 1 XP on each character typed or deleted. Pasting or deleting multiple characters at once should also add just 1 XP, not the amount of characters changed. For adding characters, SCN_CHARADDED notification is the perfect solution. For removing I was using mentioned SCN_MODIFIED checking flags, is there a better solution?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @p0358
        last edited by

        @p0358

        maybe hooking npp and both scintilla message queues and see
        if you can find a pattern which could explain that this is/was a find/replace action?

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