private void moveToWordBoundaryBash()

in core/src/com/jediterm/core/typeahead/TypeAheadTerminalModel.java [117:143]


    private void moveToWordBoundaryBash(boolean isDirectionRight) {
      String text = myLineText.toString();

      if (!isDirectionRight) {
        myCursorX -= 1;
      }

      boolean ateLeadingWhitespace = false;
      while (myCursorX >= 0) {
        if (myCursorX >= text.length()) {
          return;
        }

        char currentChar = text.charAt(myCursorX);
        if (Character.isLetterOrDigit(currentChar)) {
          ateLeadingWhitespace = true;
        } else if (ateLeadingWhitespace) {
          break;
        }

        myCursorX += isDirectionRight ? 1 : -1;
      }

      if (!isDirectionRight) {
        myCursorX += 1;
      }
    }