31#include "docs/makedoc_defs.h"
54 {
"backspace", OP_EDITOR_BACKSPACE },
55 {
"backward-char", OP_EDITOR_BACKWARD_CHAR },
56 {
"backward-word", OP_EDITOR_BACKWARD_WORD },
57 {
"bol", OP_EDITOR_BOL },
58 {
"capitalize-word", OP_EDITOR_CAPITALIZE_WORD },
59 {
"complete", OP_EDITOR_COMPLETE },
60 {
"complete-query", OP_EDITOR_COMPLETE_QUERY },
61 {
"delete-char", OP_EDITOR_DELETE_CHAR },
62 {
"downcase-word", OP_EDITOR_DOWNCASE_WORD },
63 {
"eol", OP_EDITOR_EOL },
64 {
"forward-char", OP_EDITOR_FORWARD_CHAR },
65 {
"forward-word", OP_EDITOR_FORWARD_WORD },
67 {
"history-down", OP_EDITOR_HISTORY_DOWN },
68 {
"history-search", OP_EDITOR_HISTORY_SEARCH },
69 {
"history-up", OP_EDITOR_HISTORY_UP },
70 {
"kill-eol", OP_EDITOR_KILL_EOL },
71 {
"kill-eow", OP_EDITOR_KILL_EOW },
72 {
"kill-line", OP_EDITOR_KILL_LINE },
73 {
"kill-whole-line", OP_EDITOR_KILL_WHOLE_LINE },
74 {
"kill-word", OP_EDITOR_KILL_WORD },
75 {
"mailbox-cycle", OP_EDITOR_MAILBOX_CYCLE },
76 {
"quote-char", OP_EDITOR_QUOTE_CHAR },
77 {
"redraw-screen", OP_REDRAW },
78 {
"transpose-chars", OP_EDITOR_TRANSPOSE_CHARS },
79 {
"upcase-word", OP_EDITOR_UPCASE_WORD },
81 {
"buffy-cycle", OP_EDITOR_MAILBOX_CYCLE },
89 { OP_EDITOR_BACKSPACE,
"<backspace>" },
90 { OP_EDITOR_BACKSPACE,
"\010" },
91 { OP_EDITOR_BACKSPACE,
"\177" },
92 { OP_EDITOR_BACKWARD_CHAR,
"<left>" },
93 { OP_EDITOR_BACKWARD_CHAR,
"\002" },
94 { OP_EDITOR_BACKWARD_WORD,
"\033b" },
95 { OP_EDITOR_BOL,
"<home>" },
96 { OP_EDITOR_BOL,
"\001" },
97 { OP_EDITOR_CAPITALIZE_WORD,
"\033c" },
98 { OP_EDITOR_COMPLETE,
"\t" },
99 { OP_EDITOR_COMPLETE_QUERY,
"\024" },
100 { OP_EDITOR_DELETE_CHAR,
"<delete>" },
101 { OP_EDITOR_DELETE_CHAR,
"\004" },
102 { OP_EDITOR_DOWNCASE_WORD,
"\033l" },
103 { OP_EDITOR_EOL,
"<end>" },
104 { OP_EDITOR_EOL,
"\005" },
105 { OP_EDITOR_FORWARD_CHAR,
"<right>" },
106 { OP_EDITOR_FORWARD_CHAR,
"\006" },
107 { OP_EDITOR_FORWARD_WORD,
"\033f" },
108 { OP_EDITOR_HISTORY_DOWN,
"<down>" },
109 { OP_EDITOR_HISTORY_DOWN,
"\016" },
110 { OP_EDITOR_HISTORY_SEARCH,
"\022" },
111 { OP_EDITOR_HISTORY_UP,
"<up>" },
112 { OP_EDITOR_HISTORY_UP,
"\020" },
113 { OP_EDITOR_KILL_EOL,
"\013" },
114 { OP_EDITOR_KILL_EOW,
"\033d" },
115 { OP_EDITOR_KILL_LINE,
"\025" },
116 { OP_EDITOR_KILL_WORD,
"\027" },
117 { OP_EDITOR_MAILBOX_CYCLE,
" " },
118 { OP_EDITOR_QUOTE_CHAR,
"\026" },
119 { OP_EDITOR_UPCASE_WORD,
"\033u" },
120 { OP_HELP,
"\033?" },
121 { OP_REDRAW,
"\014" },
136 wchar_t *savebuf = NULL;
141 wmemcpy(savebuf, es->
wbuf + es->
curpos, savelen);
157 wmemcpy(es->
wbuf + es->
curpos, savebuf, savelen);
175 if (wdata->
tabs == 0)
250 if (c_abort_backspace)
297 case OP_EDITOR_CAPITALIZE_WORD:
300 case OP_EDITOR_DOWNCASE_WORD:
303 case OP_EDITOR_UPCASE_WORD:
395 struct KeyEvent event = { 0, OP_NULL };
435 clearok(stdscr,
true);
484 if (!win || !win->
wdata)
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
struct KeyEvent mutt_getch(GetChFlags flags)
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 * dispatcher_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.
const struct MenuOpSeq EditorDefaultBindings[]
Key bindings for the Editor Menu.
const struct MenuFuncOp OpEditor[]
Functions for the Editor Menu.
static const struct EnterFunction EnterFunctions[]
All the NeoMutt functions that Enter supports.
void replace_part(struct EnterState *es, size_t from, const char *buf)
Search and replace on a buffer.
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_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_help(struct EnterWindowData *wdata, int op)
Display Help - 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_redraw(struct EnterWindowData *wdata, int op)
Redraw the screen - 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.
void mutt_help(enum MenuType menu)
Display the help menu.
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?
char * mutt_hist_prev(enum HistoryClass hclass)
Get the previous string in a History.
void mutt_hist_complete(char *buf, size_t buflen, enum HistoryClass hclass)
Complete a string from a history list.
#define GETCH_NO_FLAGS
No flags are set.
@ LL_DEBUG1
Log at debug level 1.
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 buf_mb_wcstombs(struct Buffer *dest, const wchar_t *wstr, size_t wlen)
Convert a string from wide to multibyte 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.
void mutt_resize_screen(void)
Update NeoMutt's opinion about the window size.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void window_invalidate_all(void)
Mark all windows as in need of repaint.
const char * opcodes_get_name(int op)
Get the name of an opcode.
#define OP_TIMEOUT
1 second with no events
#define OP_REPAINT
Repaint is needed.
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Progress Bar Window Data.
Prototypes for many functions.
size_t dsize
Length of data.
char * data
Pointer to data.
enum FunctionRetval(* complete)(struct EnterWindowData *wdata, int op)
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.
int tabs
Number of times the user has hit tab.
struct CompletionData * cd
Auto-completion state data.
struct Buffer * buffer
struct Buffer for the result
bool done
Is text-entry done?
const struct CompleteOps * comp_api
Auto-Completion API.
struct EnterState * state
Current state of text entry.
enum EnterRedrawFlags redraw
What needs redrawing? See EnterRedrawFlags.
enum HistoryClass hclass
History to use, e.g. HC_NEO_COMMAND.
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.
@ MENU_EDITOR
Text entry area.