--------------------------------------------------------------------------- | Facility : libnform | Function : static int FE_Delete_Word(FORM * form) | | Description : Delete word at cursor position | | Return Values : E_OK - success | E_REQUEST_DENIED - failure +------------------------------------------------------------------------
| 2445 | } |
| 2446 | |
| 2447 | /*--------------------------------------------------------------------------- |
| 2448 | | Facility : libnform |
| 2449 | | Function : static int FE_Delete_Word(FORM * form) |
| 2450 | | |
| 2451 | | Description : Delete word at cursor position |
| 2452 | | |
| 2453 | | Return Values : E_OK - success |
| 2454 | | E_REQUEST_DENIED - failure |
| 2455 | +--------------------------------------------------------------------------*/ |
| 2456 | static int FE_Delete_Word(FORM * form) |
| 2457 | { |
| 2458 | FIELD *field = form->current; |
| 2459 | char *bp = Address_Of_Current_Row_In_Buffer(form); |
| 2460 | char *ep = bp + field->dcols; |
| 2461 | char *cp = bp + form->curcol; |
| 2462 | char *s; |
| 2463 | |
| 2464 | Synchronize_Buffer(form); |
| 2465 | if (is_blank(*cp)) |
| 2466 | return E_REQUEST_DENIED; /* not in word */ |
| 2467 | |
| 2468 | /* move cursor to begin of word and erase to end of screen-line */ |
| 2469 | Adjust_Cursor_Position(form, |
| 2470 | After_Last_Whitespace_Character(bp,form->curcol)); |
| 2471 | wmove(form->w,form->currow,form->curcol); |
| 2472 | wclrtoeol(form->w); |
| 2473 | |
| 2474 | /* skip over word in buffer */ |
| 2475 | s = Get_First_Whitespace_Character(cp,(int)(ep-cp)); |
| 2476 | /* to begin of next word */ |
| 2477 | s = Get_Start_Of_Data(s,(int)(ep - s)); |
| 2478 | if ( (s!=cp) && !is_blank(*s)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…