mirror of
https://github.com/dvorka/hstr.git
synced 2025-01-06 15:08:13 +08:00
Sync commit (source not compilable).
This commit is contained in:
parent
5b35bbf2c0
commit
c9d9cff9d9
1 changed files with 24 additions and 7 deletions
31
src/hstr.c
31
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; i<history->count; 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; i<history->count; 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; i<history->count; i++) {
|
||||
if(strcmp(history->items[i], cmd)) {
|
||||
history->items[w]=history->items[i];
|
||||
w++;
|
||||
}
|
||||
}
|
||||
history->count=w;
|
||||
}
|
||||
history->count=w;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue