private int FindEndOfCurrentWord(int currentPos) { int pos = currentPos; while (true) { char theChar = (char)scintillaControl1.GetCharAt(pos); if ((!Char.IsLetterOrDigit(theChar)) && (theChar != '_')) { pos--; break; } pos++; } return pos; }