Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Detect when a replace operation in SyntaxEdit is cancelled

When calling something like Edit->ReplaceAll(SA,rbAllText) for a replace with prompt operation, the user may be presented with a 'Replace this occurrence of XXX?' dialog with Yes, No, and Cancel options.

Is there a way for me to know when the user selected 'Cancel'?
Tagged:

Comments

  • 6 Comments sorted by Votes Date Added
  • edited September 12 Posts: 0Vote Up0Vote Down
    There no way. And it seems useless, because replacing is a compound user workflow. The user can answer several times "Yes" and only after that - "Cancel". So, some modifications to the edit text will still be made in this case.

    Moreover, replacing can be continued by the user via pressing F3 even after "canceling" the dialog.
  • My use case is that I have a "replace in all open documents" function and it keeps moving to the next open document to repeat the search & replace operation, but if the user chooses cancel then I want to cancel the entire operation and not continue searching and replacing other documents. Without knowing that the user selected cancel, the program still moves on to the next document

    So if there is really no way to detect a cancel, then I don't think my program will be able to operate as expected when a user selects cancel when doing a 'replace in all open documents'.

    Anyway, my main point was to elaborate on my 'use case' because I do not think this feature/function would be useless.

    It's not a 'big deal' but it would be nice to address/fix if I could.

  • Ok, understood. This can be done. I'll look how to change code.
  • OK, thank you.
  • Hi,

    In addition to existing several SearchLastXxx properties I've created new SearchLastReplaceCanceled boolean property for you.
  • Great! Thank you.
Sign In or Register to comment.