62 wchar_t *savebuf = NULL;
67 memcpy(savebuf, es->
wbuf + es->
curpos, savelen *
sizeof(
wchar_t));
83 memcpy(es->
wbuf + es->
curpos, savebuf, savelen *
sizeof(
wchar_t));
112 if (wdata->
buf[0] !=
'\0')
195 if (i && (wdata->
state->
wbuf[i - 1] ==
'~'))
202 for (; (i > 0) && (wdata->
state->
wbuf[i - 1] !=
'~'); i--)
236 for (; (i > 0) && (wdata->
state->
wbuf[i - 1] !=
','); i--)
264 size_t i = strlen(wdata->
buf);
265 if ((i != 0) && (wdata->
buf[i - 1] ==
'=') &&
299 if (wdata->
buf[0] !=
'\0')
336 size_t len = strlen(wdata->
buf);
370 if (wdata->
tabs == 0)
498 if (c_abort_backspace)
500 wdata->
buf[0] =
'\0';
545 case OP_EDITOR_CAPITALIZE_WORD:
548 case OP_EDITOR_DOWNCASE_WORD:
551 case OP_EDITOR_UPCASE_WORD:
639 struct KeyEvent event = { OP_NULL, OP_NULL };
704 if (!win || !win->
wdata)
Select a Mailbox from a list.
#define MUTT_SEL_FOLDER
Select a local directory.
#define MUTT_SEL_MULTI
Multi-selection is enabled.
#define MUTT_SEL_NO_FLAGS
No flags are set.
void mutt_select_file(char *file, size_t filelen, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles)
Let the user select a file.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
int mutt_complete(struct CompletionData *cd, char *buf, size_t buflen)
Attempt to complete a partial pathname.
int mutt_var_value_complete(struct CompletionData *cd, char *buf, size_t buflen, int pos)
Complete a variable/value.
bool mutt_nm_query_complete(struct CompletionData *cd, char *buf, size_t buflen, int pos, int numtabs)
Complete to the nearest notmuch tag.
int mutt_command_complete(struct CompletionData *cd, char *buf, size_t buflen, int pos, int numtabs)
Complete a command name.
bool mutt_nm_tag_complete(struct CompletionData *cd, char *buf, size_t buflen, int numtabs)
Complete to the nearest notmuch tag.
int mutt_label_complete(struct CompletionData *cd, char *buf, size_t buflen, int numtabs)
Complete a label name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the core headers.
struct KeyEvent mutt_getch(void)
Read a character from the input buffer.
struct CompletionData * completion_data_new(void)
Create new Completion Data.
void completion_data_reset(struct CompletionData *cd)
Wipe the stored Completion Data.
const char * dispacher_get_retval_name(int rv)
Get the name of a return value.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_CONTINUE
Remain in the Dialog.
@ FR_NO_ACTION
Valid function - no action performed.
int alias_complete(char *buf, size_t buflen, struct ConfigSubset *sub)
Alias completion routine.
bool dlg_select_pattern(char *buf, size_t buflen)
Show menu to select a Pattern.
int query_complete(struct Buffer *buf, struct ConfigSubset *sub)
Perform auto-complete using an Address Query.
void mutt_pretty_mailbox(char *buf, size_t buflen)
Shorten a mailbox path using '~' or '='.
static int complete_file_simple(struct EnterWindowData *wdata)
Complete a filename.
static void replace_part(struct EnterState *es, size_t from, const char *buf)
Search and replace on a buffer.
static int complete_nm_query(struct EnterWindowData *wdata)
Complete a Notmuch Query.
static int complete_alias_complete(struct EnterWindowData *wdata)
Complete an Alias.
static int complete_file_mbox(struct EnterWindowData *wdata)
Complete a Mailbox.
static int complete_label(struct EnterWindowData *wdata)
Complete a label.
static int complete_alias_query(struct EnterWindowData *wdata)
Complete an Alias Query.
static int complete_nm_tag(struct EnterWindowData *wdata)
Complete a Notmuch Tag.
static int complete_command(struct EnterWindowData *wdata)
Complete a NeoMutt Command.
static const struct EnterFunction EnterFunctions[]
All the NeoMutt functions that Enter supports.
static int complete_pattern(struct EnterWindowData *wdata)
Complete a NeoMutt Pattern.
bool self_insert(struct EnterWindowData *wdata, int ch)
Insert a normal character.
@ ENTER_REDRAW_LINE
Redraw entire line.
@ ENTER_REDRAW_INIT
Go to end of line and redraw.
int editor_backward_word(struct EnterState *es)
Move the cursor to the beginning of the word.
bool editor_buffer_is_empty(struct EnterState *es)
Is the Enter buffer empty?
int editor_kill_line(struct EnterState *es)
Delete chars from cursor to beginning the line.
int editor_delete_char(struct EnterState *es)
Delete the char under the cursor.
int editor_bol(struct EnterState *es)
Jump to the beginning of the line.
int editor_backspace(struct EnterState *es)
Delete the char in front of the cursor.
int editor_kill_word(struct EnterState *es)
Delete the word in front of the cursor.
int editor_eol(struct EnterState *es)
Jump to the end of the line.
int editor_kill_eow(struct EnterState *es)
Delete chars from the cursor to the end of the word.
int editor_transpose_chars(struct EnterState *es)
Transpose character under cursor with previous.
int editor_kill_eol(struct EnterState *es)
Delete chars from cursor to end of line.
int editor_forward_word(struct EnterState *es)
Move the cursor to the end of the word.
int editor_backward_char(struct EnterState *es)
Move the cursor one character to the left.
int editor_case_word(struct EnterState *es, enum EnterCase ec)
Change the case of the word.
int editor_kill_whole_line(struct EnterState *es)
Delete all chars on the line.
int editor_forward_char(struct EnterState *es)
Move the cursor one character to the right.
EnterCase
Change the case of a word.
@ EC_UPCASE
Upper case (all characters)
@ EC_DOWNCASE
Lower case (all characters)
@ EC_CAPITALIZE
Capitalize word (first character only)
int enter_function_dispatcher(struct MuttWindow *win, int op)
Perform an Enter function - Implements function_dispatcher_t -.
static int op_editor_kill_line(struct EnterWindowData *wdata, int op)
Delete all chars on the line - Implements enter_function_t -.
static int op_editor_mailbox_cycle(struct EnterWindowData *wdata, int op)
Cycle among incoming mailboxes - Implements enter_function_t -.
static int op_editor_delete_char(struct EnterWindowData *wdata, int op)
Delete the char under the cursor - Implements enter_function_t -.
static int op_editor_history_down(struct EnterWindowData *wdata, int op)
Scroll down through the history list - Implements enter_function_t -.
static int op_editor_history_search(struct EnterWindowData *wdata, int op)
Search through the history list - Implements enter_function_t -.
static int op_editor_backward_char(struct EnterWindowData *wdata, int op)
Move the cursor one character to the left - Implements enter_function_t -.
static int op_editor_complete(struct EnterWindowData *wdata, int op)
Complete filename or alias - Implements enter_function_t -.
static int op_editor_history_up(struct EnterWindowData *wdata, int op)
Scroll up through the history list - Implements enter_function_t -.
static int op_editor_kill_eow(struct EnterWindowData *wdata, int op)
Delete chars from the cursor to the end of the word - Implements enter_function_t -.
static int op_editor_eol(struct EnterWindowData *wdata, int op)
Jump to the end of the line - Implements enter_function_t -.
static int op_editor_forward_word(struct EnterWindowData *wdata, int op)
Move the cursor to the end of the word - Implements enter_function_t -.
static int op_editor_backward_word(struct EnterWindowData *wdata, int op)
Move the cursor to the beginning of the word - Implements enter_function_t -.
static int op_editor_kill_word(struct EnterWindowData *wdata, int op)
Delete the word in front of the cursor - Implements enter_function_t -.
static int op_editor_quote_char(struct EnterWindowData *wdata, int op)
Quote the next typed key - Implements enter_function_t -.
static int op_editor_forward_char(struct EnterWindowData *wdata, int op)
Move the cursor one character to the right - Implements enter_function_t -.
static int op_editor_kill_whole_line(struct EnterWindowData *wdata, int op)
Delete all chars on the line - Implements enter_function_t -.
static int op_editor_transpose_chars(struct EnterWindowData *wdata, int op)
Transpose character under cursor with previous - Implements enter_function_t -.
static int op_editor_backspace(struct EnterWindowData *wdata, int op)
Delete the char in front of the cursor - Implements enter_function_t -.
static int op_editor_kill_eol(struct EnterWindowData *wdata, int op)
Delete chars from cursor to end of line - Implements enter_function_t -.
static int op_editor_capitalize_word(struct EnterWindowData *wdata, int op)
Capitalize the word - Implements enter_function_t - This function handles:
static int op_editor_bol(struct EnterWindowData *wdata, int op)
Jump to the beginning of the line - Implements enter_function_t -.
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
Helper functions to get config values.
Read/write command history from/to a file.
char * mutt_hist_next(enum HistoryClass hclass)
Get the next string in a History.
void mutt_hist_save_scratch(enum HistoryClass hclass, const char *str)
Save a temporary string to the History.
bool mutt_hist_at_scratch(enum HistoryClass hclass)
Is the current History position at the 'scratch' place?
void mutt_hist_add(enum HistoryClass hclass, const char *str, bool save)
Add a string to a history.
char * mutt_hist_prev(enum HistoryClass hclass)
Get the previous string in a History.
@ LL_DEBUG1
Log at debug level 1.
void mutt_mb_wcstombs(char *dest, size_t dlen, const wchar_t *src, size_t slen)
Convert a string from wide to multibyte characters.
bool mutt_mb_is_shell_char(wchar_t ch)
Is character not typically part of a pathname.
size_t mutt_mb_mbstowcs(wchar_t **pwbuf, size_t *pwbuflen, size_t i, const char *buf)
Convert a string from multibyte to wide characters.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Convenience wrapper for the library headers.
Keep track when processing files.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Many unsorted constants and some structs.
#define MUTT_COMP_ALIAS
Alias completion (in alias dialog)
#define MUTT_COMP_PATTERN
Pattern mode (in pattern dialog)
#define MUTT_COMP_FILE
File completion (in browser)
#define MUTT_COMP_COMMAND
Complete a NeoMutt command.
#define MUTT_COMP_NM_TAG
Notmuch tag +/- mode.
#define MUTT_COMP_LABEL
Label completion.
#define MUTT_COMP_NM_QUERY
Notmuch query mode.
#define MUTT_COMP_FILE_SIMPLE
File completion (no browser)
#define MUTT_COMP_FILE_MBOX
File completion, plus incoming folders (in browser)
void mutt_hist_complete(char *buf, size_t buflen, enum HistoryClass hclass)
Complete a string from a history list.
Read/write command history from/to a file.
struct Mailbox * mutt_mailbox_next(struct Mailbox *m_cur, struct Buffer *s)
Incoming folders completion routine.
Mailbox helper functions.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Some miscellaneous functions.
const char * opcodes_get_name(int op)
Get the name of an opcode.
All user-callable functions.
Match patterns to emails.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Progress Bar Window Data.
String manipulation buffer.
int op
Op code, e.g. OP_SEARCH.
enter_function_t function
Function to call.
Keep our place when entering a string.
size_t curpos
Position of the cursor.
size_t wbuflen
Length of buffer.
wchar_t * wbuf
Buffer for the string being entered.
size_t lastchar
Position of the last character.
Data to fill the Enter Window.
bool pass
Password mode, conceal characters.
int tabs
Number of times the user has hit tab.
int * numfiles
Number of files selected.
CompletionFlags flags
Flags, see CompletionFlags.
size_t buflen
Length of result buffer.
struct CompletionData * cd
Auto-completion state data.
bool done
Is text-entry done?
bool first
First time through, no input yet.
bool multiple
Allow multiple matches.
char *** files
List of files selected.
wchar_t * tempbuf
Buffer used by completion.
char * buf
Buffer for the result.
struct EnterState * state
Current state of text entry.
enum EnterRedrawFlags redraw
What needs redrawing? See EnterRedrawFlags.
struct Mailbox * m
Mailbox.
enum HistoryClass hclass
History to use, e.g. HC_COMMAND.
size_t templen
Length of complete buffer.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
void * wdata
Private data.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.