Enter buffer. More...
#include "config.h"
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "enter.h"
#include "state.h"
Go to the source code of this file.
Macros | |
#define | COMB_CHAR(wc) (IsWPrint(wc) && (wcwidth(wc) == 0)) |
combining mark / non-spacing character More... | |
Functions | |
int | editor_backspace (struct EnterState *es) |
Delete the char in front of the cursor. More... | |
int | editor_backward_char (struct EnterState *es) |
Move the cursor one character to the left. More... | |
int | editor_backward_word (struct EnterState *es) |
Move the cursor to the beginning of the word. More... | |
int | editor_bol (struct EnterState *es) |
Jump to the beginning of the line. More... | |
int | editor_case_word (struct EnterState *es, enum EnterCase ec) |
Change the case of the word. More... | |
int | editor_delete_char (struct EnterState *es) |
Delete the char under the cursor. More... | |
int | editor_eol (struct EnterState *es) |
Jump to the end of the line. More... | |
int | editor_forward_char (struct EnterState *es) |
Move the cursor one character to the right. More... | |
int | editor_forward_word (struct EnterState *es) |
Move the cursor to the end of the word. More... | |
int | editor_kill_eol (struct EnterState *es) |
Delete chars from cursor to end of line. More... | |
int | editor_kill_eow (struct EnterState *es) |
Delete chars from the cursor to the end of the word. More... | |
int | editor_kill_line (struct EnterState *es) |
Delete chars from cursor to beginning the line. More... | |
int | editor_kill_whole_line (struct EnterState *es) |
Delete all chars on the line. More... | |
int | editor_kill_word (struct EnterState *es) |
Delete the word in front of the cursor. More... | |
int | editor_transpose_chars (struct EnterState *es) |
Transpose character under cursor with previous. More... | |
bool | editor_buffer_is_empty (struct EnterState *es) |
Is the Enter buffer empty? More... | |
size_t | editor_buffer_get_lastchar (struct EnterState *es) |
Get the position of the last character. More... | |
size_t | editor_buffer_get_cursor (struct EnterState *es) |
Get the position of the cursor. More... | |
size_t | editor_buffer_set_cursor (struct EnterState *es, size_t pos) |
Set the position of the cursor. More... | |
int | editor_buffer_set (struct EnterState *es, const char *str) |
Set the string in the buffer. More... | |
Enter buffer.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file enter.c.
#define COMB_CHAR | ( | wc | ) | (IsWPrint(wc) && (wcwidth(wc) == 0)) |
int editor_backspace | ( | struct EnterState * | es | ) |
Delete the char in front of the cursor.
es | State of the Enter buffer |
FR_SUCCESS | Character deleted |
FR_ERROR | Failed, cursor was at the start of the buffer |
Definition at line 47 of file enter.c.
int editor_backward_char | ( | struct EnterState * | es | ) |
Move the cursor one character to the left.
es | State of the Enter buffer |
FR_SUCCESS | Cursor moved |
FR_ERROR | Failed, cursor was at the start of the buffer |
Definition at line 71 of file enter.c.
int editor_backward_word | ( | struct EnterState * | es | ) |
Move the cursor to the beginning of the word.
es | State of the Enter buffer |
FR_SUCCESS | Cursor moved |
FR_ERROR | Failed, cursor was at the start of the buffer |
Definition at line 90 of file enter.c.
int editor_bol | ( | struct EnterState * | es | ) |
int editor_case_word | ( | struct EnterState * | es, |
enum EnterCase | ec | ||
) |
Change the case of the word.
FR_SUCCESS | Case changed |
FR_ERROR | Error |
Definition at line 125 of file enter.c.
int editor_delete_char | ( | struct EnterState * | es | ) |
Delete the char under the cursor.
es | State of the Enter buffer |
FR_SUCCESS | Character deleted |
FR_ERROR | Failed, cursor was at the end of the buffer |
Definition at line 157 of file enter.c.
int editor_eol | ( | struct EnterState * | es | ) |
int editor_forward_char | ( | struct EnterState * | es | ) |
Move the cursor one character to the right.
es | State of the Enter buffer |
FR_SUCCESS | Cursor moved |
FR_ERROR | Failed, cursor was at the end of the buffer |
Definition at line 194 of file enter.c.
int editor_forward_word | ( | struct EnterState * | es | ) |
Move the cursor to the end of the word.
es | State of the Enter buffer |
FR_SUCCESS | Cursor moved |
FR_ERROR | Failed, cursor was at the end of the buffer |
Definition at line 214 of file enter.c.
int editor_kill_eol | ( | struct EnterState * | es | ) |
int editor_kill_eow | ( | struct EnterState * | es | ) |
Delete chars from the cursor to the end of the word.
es | State of the Enter buffer |
FR_SUCCESS | Characters deleted |
FR_ERROR | Error |
Definition at line 252 of file enter.c.
int editor_kill_line | ( | struct EnterState * | es | ) |
Delete chars from cursor to beginning the line.
es | State of the Enter buffer |
FR_SUCCESS | Characters deleted |
FR_ERROR | Error |
Definition at line 291 of file enter.c.
int editor_kill_whole_line | ( | struct EnterState * | es | ) |
int editor_kill_word | ( | struct EnterState * | es | ) |
Delete the word in front of the cursor.
es | State of the Enter buffer |
FR_SUCCESS | Characters deleted |
FR_ERROR | Failed, cursor was at the start of the buffer |
Definition at line 329 of file enter.c.
int editor_transpose_chars | ( | struct EnterState * | es | ) |
Transpose character under cursor with previous.
es | State of the Enter buffer |
FR_SUCCESS | Characters switched |
FR_ERROR | Failed, too few characters |
Definition at line 363 of file enter.c.
bool editor_buffer_is_empty | ( | struct EnterState * | es | ) |
size_t editor_buffer_get_lastchar | ( | struct EnterState * | es | ) |
size_t editor_buffer_get_cursor | ( | struct EnterState * | es | ) |
size_t editor_buffer_set_cursor | ( | struct EnterState * | es, |
size_t | pos | ||
) |
Set the position of the cursor.
es | State of the Enter buffer |
pos | New position for the cursor |
num | Position of cursor |
int editor_buffer_set | ( | struct EnterState * | es, |
const char * | str | ||
) |
Set the string in the buffer.
es | State of the Enter buffer |
str | String to set |
num | Length of string |
Definition at line 448 of file enter.c.