Various corrections for advanced tab completions. Should make the --export

darcs-hash:20060114015937-ac50b-c085db7526eae4aa4138ca86304e725d7faebec4.gz
This commit is contained in:
axel 2006-01-14 11:59:37 +10:00
parent 1562b8148d
commit 11273a7be0
3 changed files with 15 additions and 11 deletions

View file

@ -1372,17 +1372,23 @@ static void complete_from_args( const wchar_t *str,
array_list_t *comp_out )
{
int was_interactive = is_interactive;
is_interactive=0;
array_list_t possible_comp;
int i;
al_init( &possible_comp );
is_interactive=0;
eval_args( args, &possible_comp );
is_interactive=was_interactive;
debug( 3, L"desc is '%ls', %d long\n", desc, wcslen(desc) );
/* We need to unescape these strings before matching them */
for( i=0; i< al_get_count( &possible_comp ); i++ )
{
wchar_t *next = (wchar_t *)al_get( &possible_comp, i );
al_set( &possible_comp , i, unescape( next, 0 ) );
free( next );
}
copy_strings_with_prefix( comp_out, str, desc, 0, &possible_comp );
@ -1526,7 +1532,6 @@ void complete_load( wchar_t *cmd,
expand_variable_array( path_var, &path_list );
/*
Iterate over path searching for suitable completion files
*/

View file

@ -6,14 +6,13 @@
# written to, to make gpg use a different locale than the one
# specified in the environment or to specify an alternative home
# directory.
#
# Switches related to debugging, switches whose use is not
# recommended, switches whose behaviour is as of yet undefined,
# switches for experimental features, switches to make gpg compliant
# to legacy pgp-versions and deprecated or obsolete switches have all
# been removed. The remaining list of completions is still quite
# impressive.
#
# to legacy pgp-versions, dos-specific switches and deprecated or
# obsolete switches have all been removed. The remaining list of
# completions is still quite impressive.
#
# Various functions used for dynamic completions

View file

@ -233,7 +233,7 @@ end
function __fish_append -d "Internal completion function for appending string to the commandline"
set separator $argv[1]
set -e argv[1]
set str (commandline -tc| sed -ne "s/\(.*$separator\)[^$separator]*/\1/p")
set str (commandline -tc| sed -ne "s/\(.*$separator\)[^$separator]*/\1/p"|sed -e "s/--.*=//")
printf "%s\n" "$str"$argv "$str"(printf "%s\n" $argv|sed -e "s/\(\t\|\$\)/,\1/")
end