MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / cv_undo

Function cv_undo

extern/editline/src/chared.c:58–77  ·  view source on GitHub ↗

cv_undo(): * Handle state for the vi undo command */

Source from the content-addressed store, hash-verified

56 * Handle state for the vi undo command
57 */
58protected void
59cv_undo(EditLine *el)
60{
61 c_undo_t *vu = &el->el_chared.c_undo;
62 c_redo_t *r = &el->el_chared.c_redo;
63 size_t size;
64
65 /* Save entire line for undo */
66 size = (size_t)(el->el_line.lastchar - el->el_line.buffer);
67 vu->len = (ssize_t)size;
68 vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer);
69 (void)memcpy(vu->buf, el->el_line.buffer, size * sizeof(*vu->buf));
70
71 /* save command info for redo */
72 r->count = el->el_state.doingarg ? el->el_state.argument : 0;
73 r->action = el->el_chared.c_vcmd.action;
74 r->pos = r->buf;
75 r->cmd = el->el_state.thiscmd;
76 r->ch = el->el_state.thisch;
77}
78
79/* cv_yank():
80 * Save yank/delete data for paste

Callers 15

cv_actionFunction · 0.85
cv_pasteFunction · 0.85
vi_change_caseFunction · 0.85
vi_insert_at_bolFunction · 0.85
vi_replace_charFunction · 0.85
vi_replace_modeFunction · 0.85
vi_substitute_lineFunction · 0.85
vi_change_to_eolFunction · 0.85
vi_insertFunction · 0.85
vi_addFunction · 0.85
vi_add_at_eolFunction · 0.85
vi_undo_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected