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

Function ed_delete_next_char

extern/editline/src/common.c:138–178  ·  view source on GitHub ↗

ed_delete_next_char(): * Delete character under cursor * [^D] [x] */

Source from the content-addressed store, hash-verified

136 * [^D] [x]
137 */
138protected el_action_t
139/*ARGSUSED*/
140ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
141{
142#ifdef DEBUG_EDIT
143#define EL el->el_line
144 (void) fprintf(el->el_errlfile,
145 "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
146 EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar,
147 EL.lastchar, EL.limit, EL.limit);
148#endif
149 if (el->el_line.cursor == el->el_line.lastchar) {
150 /* if I'm at the end */
151 if (el->el_map.type == MAP_VI) {
152 if (el->el_line.cursor == el->el_line.buffer) {
153 /* if I'm also at the beginning */
154#ifdef KSHVI
155 return CC_ERROR;
156#else
157 /* then do an EOF */
158 terminal_writec(el, c);
159 return CC_EOF;
160#endif
161 } else {
162#ifdef KSHVI
163 el->el_line.cursor--;
164#else
165 return CC_ERROR;
166#endif
167 }
168 } else
169 return CC_ERROR;
170 }
171 c_delafter(el, el->el_state.argument); /* delete after dot */
172 if (el->el_map.type == MAP_VI &&
173 el->el_line.cursor >= el->el_line.lastchar &&
174 el->el_line.cursor > el->el_line.buffer)
175 /* bounds check */
176 el->el_line.cursor = el->el_line.lastchar - 1;
177 return CC_REFRESH;
178}
179
180
181/* ed_kill_line():

Callers

nothing calls this directly

Calls 2

terminal_writecFunction · 0.85
c_delafterFunction · 0.85

Tested by

no test coverage detected