Differentiate user pressing Backspace vs Find and Replace action

  • 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?

  • @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?

Log in to reply