mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 07:34:32 +00:00
Various minor cleanups
darcs-hash:20061009103408-ac50b-a54797b9f89f51a8fc8f13674e8fd2329e989d4c.gz
This commit is contained in:
parent
988a7fddf3
commit
286e110fb1
3 changed files with 35 additions and 18 deletions
|
@ -1312,6 +1312,8 @@ g++, javac, java, gcj, lpr, doxygen, whois, find)
|
|||
- Reduce the space of the pager by one line to allow the commandline to remain visible.
|
||||
- down-arrow could be used to save the current command to the history. Or give the next command in-sequnce. Or both.
|
||||
- A pretty-printer.
|
||||
- Help messages for builtin should not be compiled into fish, they should be kept in a separate directory
|
||||
- Shellscript functions should be able to show help on the commandline instead of launching a browser
|
||||
|
||||
\subsection bugs Known bugs
|
||||
|
||||
|
|
44
parser.c
44
parser.c
|
@ -3006,7 +3006,7 @@ int parser_test( const wchar_t * buff,
|
|||
int previous_pos=current_tokenizer_pos;
|
||||
static int block_pos[BLOCK_MAX_COUNT];
|
||||
static int block_type[BLOCK_MAX_COUNT];
|
||||
int res;
|
||||
int res = 0;
|
||||
|
||||
/*
|
||||
Set to 1 if the current command is inside a pipeline
|
||||
|
@ -3696,16 +3696,11 @@ int parser_test( const wchar_t * buff,
|
|||
|
||||
}
|
||||
|
||||
tok_destroy( &tok );
|
||||
|
||||
current_tokenizer=previous_tokenizer;
|
||||
current_tokenizer_pos = previous_pos;
|
||||
|
||||
error_code=0;
|
||||
|
||||
halloc_free( context );
|
||||
|
||||
res = 0;
|
||||
/*
|
||||
Fill in the unset block_level entries. Until now, only places
|
||||
where the block level _changed_ have been filled out. This fills
|
||||
in the rest.
|
||||
*/
|
||||
|
||||
if( block_level )
|
||||
{
|
||||
|
@ -3718,7 +3713,9 @@ int parser_test( const wchar_t * buff,
|
|||
{
|
||||
last_level = block_level[i];
|
||||
/*
|
||||
Make all whitespace before a token have the new level.
|
||||
Make all whitespace before a token have the new
|
||||
level. This avoid using the wrong indentation level
|
||||
if a new line starts with whitespace.
|
||||
*/
|
||||
for( j=i-1; j>=0; j-- )
|
||||
{
|
||||
|
@ -3729,6 +3726,12 @@ int parser_test( const wchar_t * buff,
|
|||
}
|
||||
block_level[i] = last_level;
|
||||
}
|
||||
|
||||
/*
|
||||
Make all trailing whitespace have the block level that the
|
||||
validator had at exit. This makes sure a new line is
|
||||
correctly indented even if it is empty.
|
||||
*/
|
||||
for( j=len-1; j>=0; j-- )
|
||||
{
|
||||
if( !wcschr( L" \n\t\r", buff[j] ) )
|
||||
|
@ -3739,6 +3742,9 @@ int parser_test( const wchar_t * buff,
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
Calculate exit status
|
||||
*/
|
||||
if( count!= 0 )
|
||||
unfinished = 1;
|
||||
|
||||
|
@ -3747,7 +3753,21 @@ int parser_test( const wchar_t * buff,
|
|||
|
||||
if( unfinished )
|
||||
res |= PARSER_TEST_INCOMPLETE;
|
||||
|
||||
/*
|
||||
Cleanup
|
||||
*/
|
||||
|
||||
halloc_free( context );
|
||||
|
||||
tok_destroy( &tok );
|
||||
|
||||
current_tokenizer=previous_tokenizer;
|
||||
current_tokenizer_pos = previous_pos;
|
||||
|
||||
error_code=0;
|
||||
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
|
7
screen.c
7
screen.c
|
@ -728,24 +728,19 @@ void s_write( screen_t *s,
|
|||
for( i=0; b[i]; i++ )
|
||||
{
|
||||
int col = c[i];
|
||||
int ind = indent[i];
|
||||
|
||||
if( i == cursor )
|
||||
{
|
||||
col = 0;
|
||||
}
|
||||
|
||||
if( b[i] == L'\n' && b[i+1] )
|
||||
ind = indent[i+1];
|
||||
|
||||
|
||||
if( i == cursor )
|
||||
{
|
||||
cursor_arr[0] = s->desired_cursor[0];
|
||||
cursor_arr[1] = s->desired_cursor[1];
|
||||
}
|
||||
|
||||
s_desired_append_char( s, b[i], col, ind, prompt_width );
|
||||
s_desired_append_char( s, b[i], col, indent[i], prompt_width );
|
||||
|
||||
if( i== cursor && s->desired_cursor[1] != cursor_arr[1] && b[i] != L'\n' )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue