mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-30 04:07:29 +08:00
Move to end of current token on completion
darcs-hash:20060311115612-ac50b-70f15c50b6cb8ad89d84ae6c8a3ffc4b7551223b.gz
This commit is contained in:
parent
0d56818664
commit
83d05f9170
|
@ -1191,7 +1191,6 @@ g++, javac, java, gcj, lpr, doxygen, whois, find)
|
|||
- Do not actually load/parse .fish_history, only mmap it and use some clever string handling. Should save ~150 kB of memory permanently, but is very hard to implement.
|
||||
- command specific wildcarding (use case * instead of case '*', etc.)
|
||||
- show the whole list of commands on using tab on an empty commandline
|
||||
- Automatically move cursor to the end of the current token before completing
|
||||
- Map variables. (export only the values. When expanding with no key specified, expand to all values.)
|
||||
- Descriptions for variables using 'set -d'.
|
||||
- Parse errors should when possible honor IO redirections
|
||||
|
|
13
reader.c
13
reader.c
|
@ -2446,11 +2446,19 @@ wchar_t *reader_readline()
|
|||
if( comp_empty )
|
||||
{
|
||||
const wchar_t *begin, *end;
|
||||
const wchar_t *token_begin, *token_end;
|
||||
wchar_t *buffcpy;
|
||||
|
||||
int len;
|
||||
int cursor_steps;
|
||||
|
||||
parse_util_cmdsubst_extent( data->buff, data->buff_pos, &begin, &end );
|
||||
|
||||
int len = data->buff_pos - (data->buff - begin);
|
||||
parse_util_token_extent( begin, data->buff_pos - (begin-data->buff), &token_begin, &token_end, 0, 0 );
|
||||
cursor_steps = token_end - data->buff- data->buff_pos;
|
||||
data->buff_pos += cursor_steps;
|
||||
move_cursor( cursor_steps );
|
||||
|
||||
len = data->buff_pos - (data->buff - begin);
|
||||
buffcpy = wcsndup( begin, len );
|
||||
|
||||
//fwprintf( stderr, L"String is %ls\n", buffcpy );
|
||||
|
@ -2463,6 +2471,7 @@ wchar_t *reader_readline()
|
|||
remove_duplicates( &comp );
|
||||
|
||||
free( buffcpy );
|
||||
|
||||
}
|
||||
if( (comp_empty =
|
||||
handle_completions( &comp ) ) )
|
||||
|
|
Loading…
Reference in New Issue
Block a user