MCPcopy Create free account
hub / github.com/SpartanJ/eepp / nextSpaceBoundaryInLine

Method nextSpaceBoundaryInLine

src/eepp/ui/doc/textdocument.cpp:1940–1958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1938}
1939
1940TextPosition TextDocument::nextSpaceBoundaryInLine( TextPosition position, std::size_t maxSeekChars,
1941 bool returnInvalidOnMaxSeek ) const {
1942 auto ch = getChar( position );
1943 bool inWord = ch != ' ';
1944 String::StringBaseType nextChar = 0;
1945 Int64 seekChars = static_cast<Int64>( maxSeekChars );
1946 do {
1947 TextPosition curPos = position;
1948 position = positionOffset( position, 1 );
1949 if ( curPos == position )
1950 break;
1951 if ( curPos.line() != position.line() ) {
1952 position = curPos;
1953 break;
1954 }
1955 nextChar = getChar( position );
1956 } while ( ( ( inWord && nextChar != ' ' ) || ( !inWord && nextChar == ch ) ) && --seekChars );
1957 return returnInvalidOnMaxSeek && seekChars == 0 ? TextPosition() : position;
1958}
1959
1960TextPosition TextDocument::startOfWord( TextPosition position ) const {
1961 while ( true ) {

Callers 1

checkMouseOverLinkMethod · 0.80

Calls 1

TextPositionFunction · 0.85

Tested by

no test coverage detected