diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-01-29 14:11:39 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-01-29 14:11:39 +0530 |
commit | 1a5d866a916ab0f7e0630c4205f3fff9b6375a3e (patch) | |
tree | 241923557f288d9d1322c263a9a10aba08163390 /builtin_complete.cpp | |
parent | a1d8ed83dd87ef963574ede8818e5fd7389f4c41 (diff) | |
parent | 062e423125bd29b3cae7ba045fca22bd2df3b1cd (diff) |
buggy-auto-complete is not so buggy now. Merged branch 'buggy-auto-complete' into CPlusPlus
Diffstat (limited to 'builtin_complete.cpp')
-rw-r--r-- | builtin_complete.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/builtin_complete.cpp b/builtin_complete.cpp index 18e953a0..15173958 100644 --- a/builtin_complete.cpp +++ b/builtin_complete.cpp @@ -541,7 +541,7 @@ static int builtin_complete( parser_t &parser, wchar_t **argv ) { if( do_complete ) { - array_list_t *comp; + std::vector<completion_t> comp; int i; const wchar_t *prev_temporary_buffer = temporary_buffer; @@ -556,16 +556,17 @@ static int builtin_complete( parser_t &parser, wchar_t **argv ) { recursion_level++; - comp = al_halloc( 0 ); +// comp = al_halloc( 0 ); - complete( do_complete, comp ); + complete2( do_complete, comp ); - for( i=0; i<al_get_count( comp ); i++ ) + for( i=0; i< comp.size() ; i++ ) { - completion_t *next = (completion_t *)al_get( comp, i ); + const completion_t &next = comp.at( i ); + const wchar_t *prepend; - if( next->flags & COMPLETE_NO_CASE ) + if( next.flags & COMPLETE_NO_CASE ) { prepend = L""; } @@ -575,17 +576,17 @@ static int builtin_complete( parser_t &parser, wchar_t **argv ) } - if( next->description ) + if( !(next.description).empty() ) { - sb_printf( sb_out, L"%ls%ls\t%ls\n", prepend, next->completion, next->description ); + sb_printf( sb_out, L"%ls%ls\t%ls\n", prepend, next.completion.c_str(), next.description.c_str() ); } else { - sb_printf( sb_out, L"%ls%ls\n", prepend, next->completion ); + sb_printf( sb_out, L"%ls%ls\n", prepend, next.completion.c_str() ); } } - halloc_free( comp ); +// halloc_free( comp ); recursion_level--; } |