MCPcopy Create free account
hub / github.com/Kitware/CMake / FE_Delete_Word

Function FE_Delete_Word

Source/CursesDialog/form/frm_driver.c:2447–2475  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | 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 +------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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+--------------------------------------------------------------------------*/
2456static 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))

Callers

nothing calls this directly

Calls 9

Synchronize_BufferFunction · 0.85
Adjust_Cursor_PositionFunction · 0.85
wmoveFunction · 0.85
wclrtoeolFunction · 0.85
Get_Start_Of_DataFunction · 0.85
waddnstrFunction · 0.85
After_End_Of_DataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…