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

Method previousSpaceBoundaryInLine

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

Source from the content-addressed store, hash-verified

1917}
1918
1919TextPosition TextDocument::previousSpaceBoundaryInLine( TextPosition position,
1920 std::size_t maxSeekChars,
1921 bool returnInvalidOnMaxSeek ) const {
1922 auto ch = getChar( positionOffset( position, -1 ) );
1923 bool inWord = ch != ' ';
1924 String::StringBaseType nextChar = 0;
1925 Int64 seekChars = static_cast<Int64>( maxSeekChars );
1926 do {
1927 TextPosition curPos = position;
1928 position = positionOffset( position, -1 );
1929 if ( curPos == position )
1930 break;
1931 if ( curPos.line() != position.line() ) {
1932 position = curPos;
1933 break;
1934 }
1935 nextChar = getChar( positionOffset( position, -1 ) );
1936 } while ( ( ( inWord && nextChar != ' ' ) || ( !inWord && nextChar == ch ) ) && --seekChars );
1937 return returnInvalidOnMaxSeek && seekChars == 0 ? TextPosition() : position;
1938}
1939
1940TextPosition TextDocument::nextSpaceBoundaryInLine( TextPosition position, std::size_t maxSeekChars,
1941 bool returnInvalidOnMaxSeek ) const {

Callers 1

checkMouseOverLinkMethod · 0.80

Calls 1

TextPositionFunction · 0.85

Tested by

no test coverage detected