MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / findPrevWord

Method findPrevWord

Engine/source/gui/controls/guiTextEditCtrl.cpp:1575–1597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1573}
1574
1575S32 GuiTextEditCtrl::findPrevWord()
1576{
1577 // First the first word to the left of the current cursor position
1578 // and return the positional index of its starting character.
1579
1580 // We define the first character of a word as any non-whitespace
1581 // character which has a non-alpha-numeric character to its immediate left.
1582
1583 const UTF8* text = mTextBuffer.getPtr8();
1584
1585 for ( S32 i = mCursorPos - 1; i > 0; i-- )
1586 {
1587 if ( !dIsspace( text[i] ) )
1588 {
1589 if ( !dIsalnum( text[i-1] ) )
1590 {
1591 return i;
1592 }
1593 }
1594 }
1595
1596 return 0;
1597}
1598
1599S32 GuiTextEditCtrl::findNextWord()
1600{

Callers

nothing calls this directly

Calls 3

dIsspaceFunction · 0.85
dIsalnumFunction · 0.85
getPtr8Method · 0.80

Tested by

no test coverage detected