39#define COMB_CHAR(wc) (IsWPrint(wc) && (wcwidth(wc) == 0))
49 if (!es || (es->
curpos == 0))
72 if (!es || (es->
curpos == 0))
91 if (!es || (es->
curpos == 0))
162 if (i < es->lastchar)
258 for (i = es->
curpos; (i < es->lastchar) && iswspace(es->
wbuf[i]); i++)
264 if (i < es->lastchar)
267 if (iswalnum(es->
wbuf[i]))
270 for (; (i < es->
lastchar) && iswalnum(es->
wbuf[i]); i++)
330 if (!es || (es->
curpos == 0))
334 while (i && iswspace(es->
wbuf[i - 1]))
338 if (iswalnum(es->
wbuf[i - 1]))
340 for (--i; (i > 0) && iswalnum(es->
wbuf[i - 1]); i--)
Convenience wrapper for the core headers.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_ERROR
Valid function - error occurred.
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.
#define COMB_CHAR(wc)
combining mark / non-spacing character
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_DOWNCASE
Lower case (all characters)
@ EC_CAPITALIZE
Capitalize word (first character only)
Convenience wrapper for the library headers.
Keep track when processing files.
Keep our place when entering a string.
size_t curpos
Position of the cursor.
wchar_t * wbuf
Buffer for the string being entered.
size_t lastchar
Position of the last character.