Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 SCINTILLANOTIFICATION.AUTOCSELECTION cannot be cancelled

all_versions
closed-fixed
5
2014-03-17
2010-09-24
Pavel Kulakov
No

Hi Dave,
As I wrote before I'm working on custom autocomplete list for my VB scripts.
So, I use a callback for SCINTILLANOTIFICATION.AUTOCSELECTION. It works fine but one thing: I cannot cancel insertion with editor.autoCCancel() although Scintilla documentation says: "Automatic insertion can be cancelled by sending a SCI_AUTOCCANCEL message before returning from the notification."

I really need this feature because standard behaviour is to insert the string into caret position - this is not correct if a user opens a list after a part of name entered. Of course I can replace incorrect text in the callback but this insertion is already in undo history!

Thanks

Discussion

  • Pavel Kulakov
    Pavel Kulakov
    2010-09-24

    Relates to PythonScript.dll 0.7.4.9

     
  • Ok - this is not really a bug, just an unintended feature :)

    It's down to the fact that Scintilla events are processed asynchronously due to threading issues doing it any other way.

    I'll try to come up with a solution to this - perhaps a separate event registration for the AUTOCSELECTION event to be handled differently (perhaps with some restrictions about what you can do, like the only editor call you can make is editor.autoCCancel()).

    Alternatively, take a look at user lists, which are similar to auto-complete, but don't auto insert (you get an index as to which entry has been chosen).
    Let me know if this works for you.

    Cheers,
    Dave.

     
  • Pavel Kulakov
    Pavel Kulakov
    2010-09-29

    Dave,
    User list has another problem. My autocompletion happens when a user presses one of keys: ENTER, SPACE or '('. In case of user list the key is typed as a character before AUTOCSELECTION event.

    So, I decided to use auto-complete list. It work fine and I can live with that side-effect.

    Thanks

     
    • status: open --> closed-fixed
    • Group: --> all_versions
     
  • This is now available in v1.0 - you can use editor.callbackSync(...) to add a synchronous callback, where you can call editor.autoCCancel()