NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Auto-Completion API

Auto-Completion API. More...

+ Collaboration diagram for Auto-Completion API:

Modules

 complete()
 Perform Auto-Completion.
 

Functions

enum FunctionRetval complete_alias_complete (struct EnterWindowData *wdata, int op)
 Complete an Alias - Implements CompleteOps::complete() -.
 

Detailed Description

Auto-Completion API.

Function Documentation

◆ complete_alias_complete()

enum FunctionRetval complete_alias_complete ( struct EnterWindowData wdata,
int  op 
)

Complete an Alias - Implements CompleteOps::complete() -.

Definition at line 41 of file complete.c.

42{
43 if (!wdata || (op != OP_EDITOR_COMPLETE))
44 return FR_NO_ACTION;
45
46 /* invoke the alias-menu to get more addresses */
47 size_t i;
48 for (i = wdata->state->curpos; (i > 0) && (wdata->state->wbuf[i - 1] != ',') &&
49 (wdata->state->wbuf[i - 1] != ':');
50 i--)
51 {
52 }
53 for (; (i < wdata->state->lastchar) && (wdata->state->wbuf[i] == ' '); i++)
54 ; // do nothing
55
56 buf_mb_wcstombs(wdata->buffer, wdata->state->wbuf + i, wdata->state->curpos - i);
57 int rc = alias_complete(wdata->buffer, NeoMutt->sub);
58 replace_part(wdata->state, i, buf_string(wdata->buffer));
59 if (rc != 1)
60 {
61 return FR_CONTINUE;
62 }
63
64 return FR_SUCCESS;
65}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
@ FR_CONTINUE
Remain in the Dialog.
Definition: dispatcher.h:34
@ FR_NO_ACTION
Valid function - no action performed.
Definition: dispatcher.h:37
int alias_complete(struct Buffer *buf, struct ConfigSubset *sub)
Alias completion routine.
Definition: dlg_alias.c:441
void replace_part(struct EnterState *es, size_t from, const char *buf)
Search and replace on a buffer.
Definition: functions.c:132
void buf_mb_wcstombs(struct Buffer *dest, const wchar_t *wstr, size_t wlen)
Convert a string from wide to multibyte characters.
Definition: mbyte.c:256
size_t curpos
Position of the cursor.
Definition: state.h:36
wchar_t * wbuf
Buffer for the string being entered.
Definition: state.h:33
size_t lastchar
Position of the last character.
Definition: state.h:35
struct Buffer * buffer
struct Buffer for the result
Definition: wdata.h:48
struct EnterState * state
Current state of text entry.
Definition: wdata.h:50
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function: