From 35e56cdb75296a6aa377701600eca9393ea67b67 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 6 Apr 2017 17:37:23 +0200 Subject: [PATCH] Merge pull request #685 from josephbisch/fix-462 Fix strange history behavior when history is empty (cherry picked from commit 3f69e718044ac87eeb5144be6113c2be33261cd0) --- src/fe-common/core/command-history.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fe-common/core/command-history.c b/src/fe-common/core/command-history.c index 1060744e..405700e5 100644 --- a/src/fe-common/core/command-history.c +++ b/src/fe-common/core/command-history.c @@ -116,6 +116,8 @@ const char *command_history_prev(WINDOW_REC *window, const char *text) history->pos = history->pos->prev; if (history->pos == NULL) history->over_counter++; + } else if (history->lines == 0) { + history->over_counter++; } else { history->pos = g_list_last(history->list); }