diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/base/cmd/cmdHist.c | 7 |
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 ); + } } } |