em_delete_or_list(): * Delete character under cursor or list completions if at end of line * [^D] */
| 51 | * [^D] |
| 52 | */ |
| 53 | protected el_action_t |
| 54 | /*ARGSUSED*/ |
| 55 | em_delete_or_list(EditLine *el, Int c) |
| 56 | { |
| 57 | |
| 58 | if (el->el_line.cursor == el->el_line.lastchar) { |
| 59 | /* if I'm at the end */ |
| 60 | if (el->el_line.cursor == el->el_line.buffer) { |
| 61 | /* and the beginning */ |
| 62 | terminal_writec(el, c); /* then do an EOF */ |
| 63 | return CC_EOF; |
| 64 | } else { |
| 65 | /* |
| 66 | * Here we could list completions, but it is an |
| 67 | * error right now |
| 68 | */ |
| 69 | terminal_beep(el); |
| 70 | return CC_ERROR; |
| 71 | } |
| 72 | } else { |
| 73 | if (el->el_state.doingarg) |
| 74 | c_delafter(el, el->el_state.argument); |
| 75 | else |
| 76 | c_delafter1(el); |
| 77 | if (el->el_line.cursor > el->el_line.lastchar) |
| 78 | el->el_line.cursor = el->el_line.lastchar; |
| 79 | /* bounds check */ |
| 80 | return CC_REFRESH; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | |
| 85 | /* em_delete_next_word(): |
nothing calls this directly
no test coverage detected