public void insertBlankCharacters()

in core/src/com/jediterm/terminal/model/TerminalLine.java [226:267]


  public void insertBlankCharacters(int x, int count, int maxLen, @NotNull TextStyle style) {
    int len = myTextEntries.length();
    len = Math.min(len + count, maxLen);

    char[] buf = new char[len];
    TextStyle[] styles = new TextStyle[len];

    int p = 0;
    for (TextEntry entry : myTextEntries) {
      for (int i = 0; i < entry.getLength() && p < len; i++) {
        if (p == x) {
          for (int j = 0; j < count && p < len; j++) {
            buf[p] = CharUtils.EMPTY_CHAR;
            styles[p] = style;
            p++;
          }
        }
        if (p < len) {
          buf[p] = entry.getText().charAt(i);
          styles[p] = entry.getStyle();
          p++;
        }
      }
      if (p >= len) {
        break;
      }
    }

    // if not inserted yet (ie. x > len)
    for (; p < x && p < len; p++) {
      buf[p] = CharUtils.EMPTY_CHAR;
      styles[p] = TextStyle.EMPTY;
      p++;
    }
    for (; p < x + count && p < len; p++) {
      buf[p] = CharUtils.EMPTY_CHAR;
      styles[p] = style;
      p++;
    }

    myTextEntries = collectFromBuffer(buf, styles);
  }