Skip to content

[tc_editline] Add callbacks for tab completion and hints #6

@darkuranium

Description

@darkuranium

Currently, only a single callback exists. Instead, multiple events should be recognized and passed to the user.

I have already decided to go with option nr. 3, but for the record, there were three options:

  1. N callbacks registered separately

    void tcedit_register_tabcomplete(int (*cb)(<...>), void* udata);
    void tcedit_register_echo(<...>, void* udata);
  2. N callbacks registered at once (via a struct)

    typedef struct TC_EditHandler {
        int (*tabcomplete)(<...>);
        <...>
        void* udata;
    } TC_EditHandler;
    void tcedit_register_handler(TC_EditHandler* handler);
  3. A single callback which is passed an event type.

    typedef struct TC_EditEvent {
        int type;
        TC_String* input;
        <...>
    } TC_EditEvent;
    typedef int TC_EditCallback(TC_EditEvent* event, void* udata);
    void tcedit_register_callback(TC_EditCallback* callback, void* udata);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions