From c9d9cff9d9d8176b7c9abd43a3679b92b5b9a03e Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Fri, 4 Apr 2014 21:54:08 +0100 Subject: [PATCH] Sync commit (source not compilable). --- src/hstr.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/hstr.c b/src/hstr.c index 617c096..946df91 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -403,15 +403,32 @@ void highlight_selection(int selectionCursorPosition, int previousSelectionCurso void selection_remove(char *cmd, HistoryItems *history) { - if(history->count) { - int i, w; - for(i=0, w=0; icount; i++) { - if(strcmp(history->items[i], cmd)) { - history->items[w]=history->items[i]; - w++; + if(historyView==HH_VIEW_FAVORITES) { + if(history->favorites->count) { + + selection must be remade & shown OR move the favorites remove code to here + + int i, w; + for(i=0, w=0; icount; i++) { + if(strcmp(history->items[i], cmd)) { + history->items[w]=history->items[i]; + w++; + } } + history->count=w; + + } + } else { + if(history->count) { + int i, w; + for(i=0, w=0; icount; i++) { + if(strcmp(history->items[i], cmd)) { + history->items[w]=history->items[i]; + w++; + } + } + history->count=w; } - history->count=w; } }