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

Method WordPartLeft

scintilla/src/Document.cxx:1898–1946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1896}
1897
1898int Document::WordPartLeft(int pos) {
1899 if (pos > 0) {
1900 --pos;
1901 char startChar = cb.CharAt(pos);
1902 if (IsWordPartSeparator(startChar)) {
1903 while (pos > 0 && IsWordPartSeparator(cb.CharAt(pos))) {
1904 --pos;
1905 }
1906 }
1907 if (pos > 0) {
1908 startChar = cb.CharAt(pos);
1909 --pos;
1910 if (IsLowerCase(startChar)) {
1911 while (pos > 0 && IsLowerCase(cb.CharAt(pos)))
1912 --pos;
1913 if (!IsUpperCase(cb.CharAt(pos)) && !IsLowerCase(cb.CharAt(pos)))
1914 ++pos;
1915 } else if (IsUpperCase(startChar)) {
1916 while (pos > 0 && IsUpperCase(cb.CharAt(pos)))
1917 --pos;
1918 if (!IsUpperCase(cb.CharAt(pos)))
1919 ++pos;
1920 } else if (IsADigit(startChar)) {
1921 while (pos > 0 && IsADigit(cb.CharAt(pos)))
1922 --pos;
1923 if (!IsADigit(cb.CharAt(pos)))
1924 ++pos;
1925 } else if (IsPunctuation(startChar)) {
1926 while (pos > 0 && IsPunctuation(cb.CharAt(pos)))
1927 --pos;
1928 if (!IsPunctuation(cb.CharAt(pos)))
1929 ++pos;
1930 } else if (isspacechar(startChar)) {
1931 while (pos > 0 && isspacechar(cb.CharAt(pos)))
1932 --pos;
1933 if (!isspacechar(cb.CharAt(pos)))
1934 ++pos;
1935 } else if (!isascii(startChar)) {
1936 while (pos > 0 && !isascii(cb.CharAt(pos)))
1937 --pos;
1938 if (isascii(cb.CharAt(pos)))
1939 ++pos;
1940 } else {
1941 ++pos;
1942 }
1943 }
1944 }
1945 return pos;
1946}
1947
1948int Document::WordPartRight(int pos) {
1949 char startChar = cb.CharAt(pos);

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