| 1917 | } |
| 1918 | |
| 1919 | TextPosition 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 | |
| 1940 | TextPosition TextDocument::nextSpaceBoundaryInLine( TextPosition position, std::size_t maxSeekChars, |
| 1941 | bool returnInvalidOnMaxSeek ) const { |
no test coverage detected