Reset list of loaded completion files when running complete_destroy. Otherwise completions will not get propely loaded on language changes.

darcs-hash:20060215024644-ac50b-d259cdac14dccb55309a4702683f1b881636e9ac.gz
This commit is contained in:
axel 2006-02-15 12:46:44 +10:00
parent 0d1683edc8
commit e58110da2c
3 changed files with 27 additions and 4 deletions

View file

@ -325,6 +325,7 @@ void complete_init()
void complete_destroy() void complete_destroy()
{ {
complete_entry *i=first_entry, *prev; complete_entry *i=first_entry, *prev;
wchar_t *path;
while( i ) while( i )
{ {
@ -341,6 +342,13 @@ void complete_destroy()
free( suffix_hash ); free( suffix_hash );
suffix_hash=0; suffix_hash=0;
} }
path = env_get( L"fish_complete_path" );
if( path )
parse_util_load_reset( path );
} }
/** /**

View file

@ -460,10 +460,23 @@ static void parse_util_destroy()
} }
} }
void parse_util_load_reset( const wchar_t *path_var )
{
if( all_loaded )
{
void *key, *data;
hash_remove( all_loaded, path_var, (const void **)&key, (const void **)&data );
if( key )
clear_loaded_entry( key, data );
}
}
int parse_util_load( const wchar_t *cmd, int parse_util_load( const wchar_t *cmd,
const wchar_t *path_var, const wchar_t *path_var,
void (*on_load)(const wchar_t *cmd), void (*on_load)(const wchar_t *cmd),
int reload ) int reload )
{ {
static array_list_t *path_list=0; static array_list_t *path_list=0;
static string_buffer_t *path=0; static string_buffer_t *path=0;

View file

@ -79,6 +79,8 @@ int parse_util_load( const wchar_t *cmd,
void (*on_load)(const wchar_t *cmd), void (*on_load)(const wchar_t *cmd),
int reload ); int reload );
void parse_util_load_reset( const wchar_t *path_var );
/** /**
Set the argv environment variable to the specified null-terminated Set the argv environment variable to the specified null-terminated
array of strings array of strings