From c8b3c0cefe8297be034e32cca6c83f1bd710da95 Mon Sep 17 00:00:00 2001 From: Jason Dillon Date: Wed, 10 May 2017 18:50:33 -0700 Subject: [PATCH] history index display is off-by-one --- builtins/src/main/java/org/jline/builtins/Commands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtins/src/main/java/org/jline/builtins/Commands.java b/builtins/src/main/java/org/jline/builtins/Commands.java index 5c91816c8..c872d20b3 100644 --- a/builtins/src/main/java/org/jline/builtins/Commands.java +++ b/builtins/src/main/java/org/jline/builtins/Commands.java @@ -191,7 +191,7 @@ public static void history(LineReader reader, PrintStream out, PrintStream err, AttributedStringBuilder sb = new AttributedStringBuilder(); sb.append(" "); sb.style(AttributedStyle.BOLD); - sb.append(String.format("%3d", entry.index())); + sb.append(String.format("%3d", entry.index() + 1)); sb.style(AttributedStyle.DEFAULT); if (opt.isSet("d")) { sb.append(" ");