54 {
N_(
"Complete"), OP_EDITOR_COMPLETE },
55 {
N_(
"Hist Up"), OP_EDITOR_HISTORY_UP },
56 {
N_(
"Hist Down"), OP_EDITOR_HISTORY_DOWN },
57 {
N_(
"Hist Search"), OP_EDITOR_HISTORY_SEARCH },
58 {
N_(
"Begin Line"), OP_EDITOR_BOL },
59 {
N_(
"End Line"), OP_EDITOR_EOL },
60 {
N_(
"Kill Line"), OP_EDITOR_KILL_LINE },
61 {
N_(
"Kill Word"), OP_EDITOR_KILL_WORD },
106 size_t k = mbrtowc(&wc, &c, 1, wdata->
mbstate);
107 if (k == (
size_t) (-2))
111 else if ((k != 0) && (k != 1))
120 wdata->
first =
false;
128 if ((wc ==
'\r') || (wc ==
'\n'))
137 char **tfiles = NULL;
142 *wdata->
files = tfiles;
146 else if (wc && ((wc <
' ') ||
IsWPrint(wc)))
181 bool multiple,
struct Mailbox *m,
char ***files,
int *numfiles)
215 clearok(stdscr,
true);
226 mbstate_t mbstate = { 0 };
235 if (es->
wbuf[0] == L
'\0')
287 for (
size_t i = wdata.
state->
begin; i < wdata.state->lastchar; i++)
315 if (event.
op == OP_NULL)
335 if ((event.
op != OP_EDITOR_COMPLETE) && (event.
op != OP_EDITOR_COMPLETE_QUERY))
362 }
while (!wdata.
done);
void mutt_buffer_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
Color and attribute parsing.
@ MT_COLOR_NORMAL
Plain text.
@ MT_COLOR_PROMPT
Question/user input.
Convenience wrapper for the core headers.
void mutt_flushinp(void)
Empty all the keyboard buffers.
void mutt_refresh(void)
Force a refresh of the screen.
int mutt_addwch(struct MuttWindow *win, wchar_t wc)
Addwch would be provided by an up-to-date curses library.
void mutt_beep(bool force)
Irritate the user.
void completion_data_free(struct CompletionData **ptr)
Free the Completion Data.
@ 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.
struct EnterState * enter_state_new(void)
Create a new EnterState.
void enter_state_free(struct EnterState **ptr)
Free an EnterState.
@ ENTER_REDRAW_NONE
Nothing to redraw.
@ ENTER_REDRAW_LINE
Redraw entire line.
@ ENTER_REDRAW_INIT
Go to end of line and redraw.
static const struct Mapping EditorHelp[]
Help Bar for the Command Line Editor.
static int my_addwch(struct MuttWindow *win, wchar_t wc)
Display one wide character on screen.
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
bool self_insert(struct EnterWindowData *wdata, int ch)
Insert a normal character.
SIG_ATOMIC_VOLATILE_T SigWinch
true after SIGWINCH is received
bool OptIgnoreMacroEvents
(pseudo) don't process macro/push/exec events while set
int enter_function_dispatcher(struct MuttWindow *win, int op)
Perform an Enter function - Implements function_dispatcher_t -.
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
@ HC_COMMAND
NeoMutt commands.
@ HC_OTHER
Miscellaneous strings.
@ HC_CMD
External commands.
void mutt_hist_add(enum HistoryClass hclass, const char *str, bool save)
Add a string to a history.
void mutt_hist_reset_state(enum HistoryClass hclass)
Move the 'current' position to the end of the History.
struct KeyEvent km_dokey_event(enum MenuType mtype)
Determine what a keypress should do.
@ 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.
size_t mutt_mb_width_ceiling(const wchar_t *s, size_t n, int w1)
Keep the end of the string on-screen.
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.
int mutt_mb_wcswidth(const wchar_t *s, size_t n)
Measure the screen width of a string.
int mutt_mb_wcwidth(wchar_t wc)
Measure the screen width of a character.
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.
void msgcont_push_window(struct MuttWindow *win)
Add a window to the Container Stack.
struct MuttWindow * msgcont_pop_window(void)
Remove the last Window from the Container Stack.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
Many unsorted constants and some structs.
#define MUTT_COMP_ALIAS
Alias completion (in alias dialog)
#define MUTT_COMP_PASS
Password mode (no echo)
#define MUTT_COMP_UNBUFFERED
Ignore macro buffer.
#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.
uint16_t CompletionFlags
Flags for mutt_enter_string_full(), e.g. MUTT_COMP_ALIAS.
#define MUTT_COMP_FILE_SIMPLE
File completion (no browser)
#define MUTT_COMP_FILE_MBOX
File completion, plus incoming folders (in browser)
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
enum MuttCursorState mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
struct AttrColor * mutt_curses_set_normal_backed_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the colour id.
void mutt_resize_screen(void)
Update NeoMutt's opinion about the window size (CURSES)
MuttCursorState
Cursor states for mutt_curses_set_cursor()
@ MUTT_CURSOR_VISIBLE
Display a normal cursor.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
int mutt_window_printf(struct MuttWindow *win, const char *fmt,...)
Write a formatted string to a Window.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
void mutt_window_get_coords(struct MuttWindow *win, int *col, int *row)
Get the cursor position in the Window.
void mutt_window_clearline(struct MuttWindow *win, int row)
Clear a row of a Window.
int mutt_window_addstr(struct MuttWindow *win, const char *str)
Write a string to a Window.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
#define WA_RECALC
Recalculate the contents of the Window.
@ WT_CUSTOM
Window with a custom drawing function.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
char * mutt_expand_path(char *buf, size_t buflen)
Create the canonical path.
Some miscellaneous functions.
const char * opcodes_get_name(int op)
Get the name of an opcode.
All user-callable functions.
Progress Bar Window Data.
String manipulation buffer.
Keep our place when entering a string.
size_t curpos
Position of the cursor.
size_t wbuflen
Length of buffer.
size_t begin
Position of the start.
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.
int col
Initial cursor positions.
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.
mbstate_t * mbstate
Multi-byte state.
struct Mailbox * m
Mailbox.
enum HistoryClass hclass
History to use, e.g. HC_COMMAND.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
Mapping between user-readable string and a constant.
const struct Mapping * help_data
Data for the Help Bar.
struct WindowState state
Current state of the Window.
void * wdata
Private data.
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_EDITOR
Text entry area.