cv_next_word(): * Find the next word vi style */
| 275 | * Find the next word vi style |
| 276 | */ |
| 277 | protected Char * |
| 278 | cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int)) |
| 279 | { |
| 280 | int test; |
| 281 | |
| 282 | while (n--) { |
| 283 | test = (*wtest)(*p); |
| 284 | while ((p < high) && (*wtest)(*p) == test) |
| 285 | p++; |
| 286 | /* |
| 287 | * vi historically deletes with cw only the word preserving the |
| 288 | * trailing whitespace! This is not what 'w' does.. |
| 289 | */ |
| 290 | if (n || el->el_chared.c_vcmd.action != (DELETE|INSERT)) |
| 291 | while ((p < high) && Isspace(*p)) |
| 292 | p++; |
| 293 | } |
| 294 | |
| 295 | /* p now points where we want it */ |
| 296 | if (p > high) |
| 297 | return high; |
| 298 | else |
| 299 | return p; |
| 300 | } |
| 301 | |
| 302 | |
| 303 | /* cv_prev_word(): |
no outgoing calls
no test coverage detected