Editor (src/editor.c)
Key functions and behavior:
get_line_start(line)— Return buffer offset for the start of logical lineline.get_line_length_at_off(off)— Return number of characters on the line starting at buffer offsetoff(excludes newline).cursor_to_offset()— Converteditor_cursor_x/editor_cursor_yto a buffer offset.insert_char_at(off, ch)— Insertchat buffer offsetoff, shifting contents and updating state.delete_char_before(off)— Delete character before offsetoff(backspace semantics).editor_draw()— Redraw title bar, visible text window, cursor and status bar.editor_open(fname, mode)— Loadfnameinto the editor buffer and switch to editor mode.editor_handle_key(key, mode)— Handle navigation, editing, and save/exit shortcuts (Ctrl+S/Ctrl+X).editor_set_cursor_pos(x, y)— (optional,EDITOR_MOUSE_SUPPORT) Map a mouse click to editor cursor coordinates and clamp safely.
Source: src/editor.c