improve history command

This commit is contained in:
hengyunabc committed 2018-11-26 00:48:09 +08:00
1 parent 744beefe0e
commit d667bc12f0
1 file changed
+2 -3
@@ -15,6 +15,7 @@ import com.taobao.middleware.cli.annotations.Option;
import com.taobao.middleware.cli.annotations.Summary; import com.taobao.middleware.cli.annotations.Summary;
import io.termd.core.readline.Readline; import io.termd.core.readline.Readline;
import io.termd.core.util.Helper;
/** /**
* *
@@ -62,9 +63,7 @@ public class HistoryCommand extends AnnotatedCommand {
for (int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
int[] line = history.get(n - i - 1); int[] line = history.get(n - i - 1);
sb.append(String.format("%5s ", size - (n - i - 1))); sb.append(String.format("%5s ", size - (n - i - 1)));
for (int codePoint : line) { Helper.appendCodePoints(line, sb);
sb.append(Character.toChars(codePoint));
}
sb.append('\n'); sb.append('\n');
} }