MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / WordPartRight

Method WordPartRight

scintilla/src/Document.cxx:1948–1986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1946}
1947
1948int Document::WordPartRight(int pos) {
1949 char startChar = cb.CharAt(pos);
1950 int length = Length();
1951 if (IsWordPartSeparator(startChar)) {
1952 while (pos < length && IsWordPartSeparator(cb.CharAt(pos)))
1953 ++pos;
1954 startChar = cb.CharAt(pos);
1955 }
1956 if (!isascii(startChar)) {
1957 while (pos < length && !isascii(cb.CharAt(pos)))
1958 ++pos;
1959 } else if (IsLowerCase(startChar)) {
1960 while (pos < length && IsLowerCase(cb.CharAt(pos)))
1961 ++pos;
1962 } else if (IsUpperCase(startChar)) {
1963 if (IsLowerCase(cb.CharAt(pos + 1))) {
1964 ++pos;
1965 while (pos < length && IsLowerCase(cb.CharAt(pos)))
1966 ++pos;
1967 } else {
1968 while (pos < length && IsUpperCase(cb.CharAt(pos)))
1969 ++pos;
1970 }
1971 if (IsLowerCase(cb.CharAt(pos)) && IsUpperCase(cb.CharAt(pos - 1)))
1972 --pos;
1973 } else if (IsADigit(startChar)) {
1974 while (pos < length && IsADigit(cb.CharAt(pos)))
1975 ++pos;
1976 } else if (IsPunctuation(startChar)) {
1977 while (pos < length && IsPunctuation(cb.CharAt(pos)))
1978 ++pos;
1979 } else if (isspacechar(startChar)) {
1980 while (pos < length && isspacechar(cb.CharAt(pos)))
1981 ++pos;
1982 } else {
1983 ++pos;
1984 }
1985 return pos;
1986}
1987
1988bool IsLineEndChar(char c) {
1989 return (c == '\n' || c == '\r');

Callers 1

KeyCommandMethod · 0.80

Calls 6

IsLowerCaseFunction · 0.85
IsUpperCaseFunction · 0.85
IsADigitFunction · 0.85
IsPunctuationFunction · 0.85
isspacecharFunction · 0.85
CharAtMethod · 0.45

Tested by

no test coverage detected