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

Function cv_action

extern/editline/src/vi.c:60–87  ·  view source on GitHub ↗

cv_action(): * Handle vi actions. */

Source from the content-addressed store, hash-verified

58 * Handle vi actions.
59 */
60private el_action_t
61cv_action(EditLine *el, Int c)
62{
63
64 if (el->el_chared.c_vcmd.action != NOP) {
65 /* 'cc', 'dd' and (possibly) friends */
66 if (c != (Int)el->el_chared.c_vcmd.action)
67 return CC_ERROR;
68
69 if (!(c & YANK))
70 cv_undo(el);
71 cv_yank(el, el->el_line.buffer,
72 (int)(el->el_line.lastchar - el->el_line.buffer));
73 el->el_chared.c_vcmd.action = NOP;
74 el->el_chared.c_vcmd.pos = 0;
75 if (!(c & YANK)) {
76 el->el_line.lastchar = el->el_line.buffer;
77 el->el_line.cursor = el->el_line.buffer;
78 }
79 if (c & INSERT)
80 el->el_map.current = el->el_map.key;
81
82 return CC_REFRESH;
83 }
84 el->el_chared.c_vcmd.pos = el->el_line.cursor;
85 el->el_chared.c_vcmd.action = c;
86 return CC_ARGHACK;
87}
88
89/* cv_paste():
90 * Paste previous deletion before or after the cursor

Callers 3

vi_change_metaFunction · 0.85
vi_delete_metaFunction · 0.85
vi_yankFunction · 0.85

Calls 2

cv_undoFunction · 0.85
cv_yankFunction · 0.85

Tested by

no test coverage detected