mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Various corrections for advanced tab completions. Should make the --export
darcs-hash:20060114015937-ac50b-c085db7526eae4aa4138ca86304e725d7faebec4.gz
This commit is contained in:
parent
1562b8148d
commit
11273a7be0
3 changed files with 15 additions and 11 deletions
15
complete.c
15
complete.c
|
@ -1372,17 +1372,23 @@ static void complete_from_args( const wchar_t *str,
|
||||||
array_list_t *comp_out )
|
array_list_t *comp_out )
|
||||||
{
|
{
|
||||||
int was_interactive = is_interactive;
|
int was_interactive = is_interactive;
|
||||||
is_interactive=0;
|
|
||||||
|
|
||||||
array_list_t possible_comp;
|
array_list_t possible_comp;
|
||||||
|
int i;
|
||||||
|
|
||||||
al_init( &possible_comp );
|
al_init( &possible_comp );
|
||||||
|
|
||||||
|
is_interactive=0;
|
||||||
eval_args( args, &possible_comp );
|
eval_args( args, &possible_comp );
|
||||||
|
|
||||||
is_interactive=was_interactive;
|
is_interactive=was_interactive;
|
||||||
|
|
||||||
|
/* We need to unescape these strings before matching them */
|
||||||
debug( 3, L"desc is '%ls', %d long\n", desc, wcslen(desc) );
|
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 );
|
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 );
|
expand_variable_array( path_var, &path_list );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Iterate over path searching for suitable completion files
|
Iterate over path searching for suitable completion files
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,14 +6,13 @@
|
||||||
# written to, to make gpg use a different locale than the one
|
# written to, to make gpg use a different locale than the one
|
||||||
# specified in the environment or to specify an alternative home
|
# specified in the environment or to specify an alternative home
|
||||||
# directory.
|
# directory.
|
||||||
#
|
|
||||||
# Switches related to debugging, switches whose use is not
|
# Switches related to debugging, switches whose use is not
|
||||||
# recommended, switches whose behaviour is as of yet undefined,
|
# recommended, switches whose behaviour is as of yet undefined,
|
||||||
# switches for experimental features, switches to make gpg compliant
|
# switches for experimental features, switches to make gpg compliant
|
||||||
# to legacy pgp-versions and deprecated or obsolete switches have all
|
# to legacy pgp-versions, dos-specific switches and deprecated or
|
||||||
# been removed. The remaining list of completions is still quite
|
# obsolete switches have all been removed. The remaining list of
|
||||||
# impressive.
|
# completions is still quite impressive.
|
||||||
#
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Various functions used for dynamic completions
|
# Various functions used for dynamic completions
|
||||||
|
|
|
@ -233,7 +233,7 @@ end
|
||||||
function __fish_append -d "Internal completion function for appending string to the commandline"
|
function __fish_append -d "Internal completion function for appending string to the commandline"
|
||||||
set separator $argv[1]
|
set separator $argv[1]
|
||||||
set -e 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/")
|
printf "%s\n" "$str"$argv "$str"(printf "%s\n" $argv|sed -e "s/\(\t\|\$\)/,\1/")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue