FindEndOfCurrentWordWithSpace is almost the same as FindEndOfCurrentWord. The only difference is to ignore contiguous spaces.
()
| 200 | // FindEndOfCurrentWordWithSpace is almost the same as FindEndOfCurrentWord. |
| 201 | // The only difference is to ignore contiguous spaces. |
| 202 | func (d *Document) FindEndOfCurrentWordWithSpace() int { |
| 203 | x := d.TextAfterCursor() |
| 204 | |
| 205 | start := istrings.IndexNotByte(x, ' ') |
| 206 | if start == -1 { |
| 207 | return len(x) |
| 208 | } |
| 209 | |
| 210 | end := strings.IndexByte(x[start:], ' ') |
| 211 | if end == -1 { |
| 212 | return len(x) |
| 213 | } |
| 214 | |
| 215 | return start + end |
| 216 | } |
| 217 | |
| 218 | // FindEndOfCurrentWordUntilSeparator is almost the same as FindEndOfCurrentWord. |
| 219 | // But this can specify Separator. Return 0 if nothing was found. |