|
ze
|

Files | |
| file | edit.c |
| Editing primitives implementation. | |
Functions | |
| void | editorInsertChar (int c) |
| Insert a character at the current cursor position. | |
| void | editorInsertTimestamp (void) |
| Insert a formatted local timestamp string at the cursor. | |
| void | editorInsertNewline (void) |
| Insert a newline at the cursor position, splitting the line if needed. | |
| void | editorDelChar (void) |
| Delete the character left of the cursor or join with previous row. | |
| void editorDelChar | ( | void | ) |
Delete the character left of the cursor or join with previous row.
If at the beginning of a line (column 0) and not at the top of the file, joins the current line into the end of the previous line. Otherwise deletes the character before the cursor. Cursor and dirty state are updated.
| void editorInsertChar | ( | int | c | ) |
Insert a character at the current cursor position.
If the cursor is positioned at the end of the buffer (on the phantom line equal to E.numrows), a new empty line is created first. The character is inserted into the current row at column E.cx and the cursor advances by 1. Dirty state and render cache are updated via row helpers.
| [in] | c | Character code to insert. Only the low 8 bits are used. |
E.cx may increase, E.numrows may increase on first insert, and the buffer contents are modified. | void editorInsertNewline | ( | void | ) |
Insert a newline at the cursor position, splitting the line if needed.
If E.cx is 0, inserts an empty line above the current line. Otherwise, splits the current row at E.cx, moving the tail to the next line. Advances the cursor to the beginning of the new line.
E.cy increments, E.cx becomes 0. Buffer rows are re-rendered. | void editorInsertTimestamp | ( | void | ) |
Insert a formatted local timestamp string at the cursor.
Inserts the current local time formatted as "%Y-%m-%d %H:%M:%S" by calling editorInsertChar() for each character.