docs: public int xIndex(int loc) {
          int chars1 = 0;
          int chars2 = 0;
          int last_chars1 = 0;
          int last_chars2 = 0;
          Change lastDiff = null;
          for (Change aDiff : getChangeList()) {
              if (aDiff.operation != Operation.INSERT) {
                  // Equality or deletion.
                  chars1 += aDiff.text.length();
              }
              if (aDiff.operation != Operation.DELETE) {
                  // Equality or insertion.
                  chars2 += aDiff.text.length();
              }
              if (chars1 > loc) {
                  // Overshot the location.
                  lastDiff = aDiff;
                  break;
              }
              last_chars1 = chars1;
              last_chars2 = chars2;
          }
          if (lastDiff != null && lastDiff.operation == Operation.DELETE) {
              // The location was deleted.
              return last_chars2;
          }
          // Add the remaining character length.
          return last_chars2 + (loc - last_chars1);
      }