mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Migrate input_function_get_names to wcstring_list_t
This commit is contained in:
parent
0d1c2a3b2a
commit
4dfe36feb1
3 changed files with 7 additions and 20 deletions
13
builtin.cpp
13
builtin.cpp
|
@ -465,20 +465,13 @@ static void builtin_bind_key_names( int all )
|
|||
*/
|
||||
static void builtin_bind_function_names()
|
||||
{
|
||||
array_list_t lst;
|
||||
int i;
|
||||
wcstring_list_t names = input_function_get_names();
|
||||
|
||||
al_init( &lst );
|
||||
input_function_get_names( &lst );
|
||||
|
||||
for( i=0; i<al_get_count(&lst); i++ )
|
||||
for( size_t i=0; i<names.size(); i++ )
|
||||
{
|
||||
wchar_t *seq = (wchar_t *)al_get( &lst, i );
|
||||
|
||||
const wchar_t *seq = names.at(i).c_str();
|
||||
sb_printf( sb_out, L"%ls\n", seq );
|
||||
}
|
||||
|
||||
al_destroy( &lst );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
12
input.cpp
12
input.cpp
|
@ -835,16 +835,10 @@ void input_terminfo_get_names( array_list_t *lst, int skip_null )
|
|||
}
|
||||
}
|
||||
|
||||
void input_function_get_names( array_list_t *lst )
|
||||
wcstring_list_t input_function_get_names( void )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
CHECK( lst, );
|
||||
|
||||
for( i=0; i<(sizeof(name_arr)/sizeof(wchar_t *)); i++ )
|
||||
{
|
||||
al_push( lst, name_arr[i] );
|
||||
}
|
||||
size_t count = sizeof name_arr / sizeof *name_arr;
|
||||
return wcstring_list_t(name_arr, name_arr + count);
|
||||
}
|
||||
|
||||
wchar_t input_function_get_code( const wcstring &name )
|
||||
|
|
2
input.h
2
input.h
|
@ -138,7 +138,7 @@ wchar_t input_function_get_code( const wcstring &name );
|
|||
/**
|
||||
Returns a list of all existing input function names
|
||||
*/
|
||||
void input_function_get_names( array_list_t *lst );
|
||||
wcstring_list_t input_function_get_names( void );
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue