#1109 Add new notification for Auto Complete Insertion Done

Committed
closed
3
2015-08-03
2015-06-02
No

Add a new notification, SCN_AUTOCCOMPLETE, which is fired after a auto-completion is fully complete. Position and text would be filled in as in SCN_AUTOCSELECTION.

Also would be nice to fill in ch of notify structure with the selected fill up or tab key. Also this for SCN_AUTOCSELECTION.

It is not trivial to calculate how to correctly delete partially typed auto-complete entries in the case for the need of the auto-completed text to be inserted differently based, especially based on all possible scintilla options. I had to basically re-implement ScintillaBase::AutoCompleteCompleted and a few helpers with direct commands to get it to behave correctly, when really all I needed to do was mess with the character that was placed after the auto-complete text was inserted.

Related

Feature Requests: #441

Discussion

  • Neil Hodgson

    Neil Hodgson - 2015-06-02
    • labels: --> scintilla, autocomplete
    • assigned_to: Neil Hodgson
    • Priority: 5 --> 3
     
  • Jonathan Hunt

    Jonathan Hunt - 2015-06-17

    Patch attached.

    Adds 2 new notifications, SCN_AUTOCCOMPLETE and SCN_USERLISTCOMPLETE fired after auto completion \ user list text is inserted.

    New field in SCNotification listCompletionMethod which is SC_AC_FILLUP, SC_AC_DOUBLECLICK, SC_AC_TAB, SC_AC_NEWLINE,
    or SC_AC_COMMAND based on how the completion occurred. If SC_AC_FILLUP, ch = fillup char used, otherwise ch = 0.

    ch and listCompletionMethod also apply to SCN_AUTOCSELECTION and SCN_USERLISTSELECTION.

    Documentation included.

    I really don't have any idea what Scintilla.iface is, but I tried to edit it as correctly as possible based on the data already present in it.

     
    Last edit: Jonathan Hunt 2015-06-18
    • Neil Hodgson

      Neil Hodgson - 2015-06-18

      The patch was rejected by hg import. While there are a few issues, the primary problem is that the patch is inverted. That is, the patch is written to go from your changed version back to the original.

      A good way to get an easily applied patch is to commit the change to a local Hg repository cloned from the main repo and then use "hg export".

      In Scintilla.iface, there is a new "evt" called AutoCComplete. There is already a "fun" API called AutoCComplete which can be used by the application to force a selection. To avoid a clash the evt should be named differently, perhaps AutoCCompleted or AutoCCompletion.

       
  • Jonathan Hunt

    Jonathan Hunt - 2015-06-18

    Fixed patch direction.
    Changed notification names to SCN_AUTOCCOMPLETED and SCN_USERLISTCOMPLETED in source, documentation, iface file.
    Fixed broken links and spelling errors in documentation.
    Fixed variable name in iface file for listCompletionMethod.

    For now I'm just working with downloaded copies of the source and Beyond Compare. If I try to tackle the call-tip styling, I'll figure out how to use Mercurial.

     
    • Neil Hodgson

      Neil Hodgson - 2015-06-19

      Using powers of 2 for the SC_AC_* constants implies a bit set where more than one bit can be set but the completion methods appear distinct with no possibility of multiple bits being set.

      Repeating the SC_AC_* explanation table appears unnecessary - I'd just link from one notification to the other's table.

       
  • Neil Hodgson

    Neil Hodgson - 2015-07-01

    I should have realised this earlier: user lists do not insert text. They are just a way for the application to show a list and receive a choice.

    SCN_USERLISTCOMPLETED will never occur. Look at where the SCN_USERLISTCOMPLETED notification is created where its contingent on "(listType > 0)" but 10 lines earlier there is "if (listType > 0) return;".

     
  • Neil Hodgson

    Neil Hodgson - 2015-07-02
    • Group: Completed --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2015-07-02

    Committed as [a09a4b]. Includes minor change to HTML to close tags and normalize whitespace.

     

    Related

    Commit: [a09a4b]

  • Neil Hodgson

    Neil Hodgson - 2015-08-03
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks