| 1573 | } |
| 1574 | |
| 1575 | S32 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 | |
| 1599 | S32 GuiTextEditCtrl::findNextWord() |
| 1600 | { |