MCPcopy Create free account
hub / github.com/VCVRack/Rack / cursorToPrevWord

Method cursorToPrevWord

src/ui/TextField.cpp:391–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391void TextField::cursorToPrevWord() {
392 if (password) {
393 cursor = 0;
394 return;
395 }
396 size_t pos = text.rfind(' ', std::max(cursor - 2, 0));
397 if (pos == std::string::npos)
398 cursor = 0;
399 else
400 cursor = std::min((int) pos + 1, (int) text.size());
401}
402
403void TextField::cursorToNextWord() {
404 if (password) {

Callers

nothing calls this directly

Calls 3

maxFunction · 0.85
minFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected