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

Function em_yank

extern/editline/src/emacs.c:118–147  ·  view source on GitHub ↗

em_yank(): * Paste cut buffer at cursor position * [^Y] */

Source from the content-addressed store, hash-verified

116 * [^Y]
117 */
118protected el_action_t
119/*ARGSUSED*/
120em_yank(EditLine *el, Int c __attribute__((__unused__)))
121{
122 Char *kp, *cp;
123
124 if (el->el_chared.c_kill.last == el->el_chared.c_kill.buf)
125 return CC_NORM;
126
127 if (el->el_line.lastchar +
128 (el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >=
129 el->el_line.limit)
130 return CC_ERROR;
131
132 el->el_chared.c_kill.mark = el->el_line.cursor;
133 cp = el->el_line.cursor;
134
135 /* open the space, */
136 c_insert(el,
137 (int)(el->el_chared.c_kill.last - el->el_chared.c_kill.buf));
138 /* copy the chars */
139 for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++)
140 *cp++ = *kp;
141
142 /* if an arg, cursor at beginning else cursor at end */
143 if (el->el_state.argument == 1)
144 el->el_line.cursor = cp;
145
146 return CC_REFRESH;
147}
148
149
150/* em_kill_line():

Callers

nothing calls this directly

Calls 1

c_insertFunction · 0.85

Tested by

no test coverage detected