summaryrefslogtreecommitdiffstats
path: root/src/base/cmd/cmdHist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/cmd/cmdHist.c')
-rw-r--r--src/base/cmd/cmdHist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/base/cmd/cmdHist.c b/src/base/cmd/cmdHist.c
index 5885b1b5..29a51452 100644
--- a/src/base/cmd/cmdHist.c
+++ b/src/base/cmd/cmdHist.c
@@ -67,10 +67,15 @@ void Cmd_HistoryAddCommand( Abc_Frame_t * p, const char * command )
if ( !strcmp(pStr, Buffer) )
break;
if ( i == Vec_PtrSize(p->aHistory) )
- {
+ { // add new entry
Vec_PtrPush( p->aHistory, Extra_UtilStrsav(Buffer) );
Cmd_HistoryWrite( p, nLastSaved );
}
+ else
+ { // put at the end
+ Vec_PtrRemove( p->aHistory, pStr );
+ Vec_PtrPush( p->aHistory, pStr );
+ }
}
}