Exemplo n.º 1
0
  private void setLastPattern(@NotNull Editor editor, @NotNull String lastPattern) {
    this.lastPattern = lastPattern;
    VimPlugin.getRegister()
        .storeTextInternal(
            editor, new TextRange(-1, -1), lastPattern, SelectionType.CHARACTER_WISE, '/', false);

    VimPlugin.getHistory().addEntry(HistoryGroup.SEARCH, lastPattern);
  }
Exemplo n.º 2
0
  @NotNull
  private String processKey(String key, int start, int end) {
    if (logger.isDebugEnabled()) {
      logger.debug("process " + key + " " + start + "," + end);
    }

    StringBuffer res = new StringBuffer();

    res.append("      #  ").append(key).append(" ").append("history\n");

    String spaces = "       ";
    List<HistoryGroup.HistoryEntry> entries = VimPlugin.getHistory().getEntries(key, start, end);
    for (HistoryGroup.HistoryEntry entry : entries) {
      String num = Integer.toString(entry.getNumber());
      res.append(spaces.substring(num.length()))
          .append(num)
          .append("  ")
          .append(entry.getEntry())
          .append("\n");
    }

    return res.toString();
  }