mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Allow tab completion of empty command names
darcs-hash:20060521223213-ac50b-5201b7f0dfe5227f93aae6db94450e165c9a5a34.gz
This commit is contained in:
parent
b746a803a9
commit
29e86254d0
1 changed files with 22 additions and 3 deletions
25
complete.c
25
complete.c
|
@ -2023,9 +2023,28 @@ void complete( const wchar_t *cmd,
|
|||
current_token = wcsndup( begin, cursor_pos-(begin-cmd) );
|
||||
|
||||
prev_token = prev_begin ? wcsndup( prev_begin, prev_end - prev_begin ): wcsdup(L"");
|
||||
|
||||
|
||||
// fwprintf( stderr, L"on_command: %d, %ls %ls\n", on_command, current_compmand, current_token );
|
||||
|
||||
if( !had_cmd )
|
||||
{
|
||||
on_command=1;
|
||||
}
|
||||
|
||||
if( !current_token )
|
||||
{
|
||||
current_token = wcsdup(L"");
|
||||
}
|
||||
|
||||
if( !current_command )
|
||||
{
|
||||
current_command = wcsdup(L"");
|
||||
}
|
||||
|
||||
if( !prev_token )
|
||||
{
|
||||
prev_token = wcsdup(L"");
|
||||
}
|
||||
|
||||
if( current_token && current_command && prev_token )
|
||||
{
|
||||
if( on_command )
|
||||
|
@ -2045,7 +2064,7 @@ void complete( const wchar_t *cmd,
|
|||
*/
|
||||
|
||||
int do_file;
|
||||
|
||||
|
||||
do_file = complete_param( current_command, prev_token, current_token, comp );
|
||||
complete_param_expand( current_token, comp, do_file );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue