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

Method cursorToLineStart

src/ui/TextField.cpp:414–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void TextField::cursorToLineStart() {
415 if (password) {
416 cursor = 0;
417 return;
418 }
419 size_t pos = text.rfind('\n', std::max(cursor - 1, 0));
420 if (pos == std::string::npos)
421 cursor = 0;
422 else
423 cursor = std::min((int) pos + 1, (int) text.size());
424}
425
426void TextField::cursorToLineEnd() {
427 if (password) {

Callers

nothing calls this directly

Calls 3

maxFunction · 0.85
minFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected