diff --git a/common.h b/common.h index 99c5671e0..4b8928d5f 100644 --- a/common.h +++ b/common.h @@ -72,7 +72,7 @@ extern wchar_t *program_name; This macro is used to check that an input argument is not null. It is a bit lika a non-fatal form of assert. Instead of exit-ing on failiure, the current function is ended at once. The second - parameter is the exit status of the current function on failiure. + parameter is the return value of the current function on failiure. */ #define CHECK( arg, retval ) \ if( !(arg) ) \ @@ -88,7 +88,7 @@ extern wchar_t *program_name; } /** - Exit program at once, leaving an error message about running out of memory + Exit program at once, leaving an error message about running out of memory. */ #define DIE_MEM() \ { \ @@ -100,7 +100,8 @@ extern wchar_t *program_name; } /** - Cause fish to crash. This should only be usd for debugging. + Cause fish to crash. This should only be used for debugging. If + this function is ever called in shipped code, this is a bug. */ #define CRASH() \ { \ @@ -109,7 +110,8 @@ extern wchar_t *program_name; } /** - Check if signals are blocked + Check if signals are blocked. If so, print an error message and + return from the function performing this check. */ #define CHECK_BLOCK( retval ) \ if( signal_is_blocked() ) \ @@ -120,7 +122,7 @@ extern wchar_t *program_name; L"If you can reproduce it, please send a bug report to %s.", \ __func__, \ PACKAGE_BUGREPORT ); \ - return retval; \ + return retval; \ } /** @@ -129,7 +131,8 @@ extern wchar_t *program_name; #define _(wstr) wgettext(wstr) /** - Noop, used to tell xgettext that a string should be translated, even though it is not directly sent to wgettext. + Noop, used to tell xgettext that a string should be translated, + even though it is not directly sent to wgettext. */ #define N_(wstr) wstr diff --git a/complete.h b/complete.h index ebae4a1d9..fd0d94031 100644 --- a/complete.h +++ b/complete.h @@ -66,11 +66,6 @@ */ #define PROG_COMPLETE_SEP L'\t' -/** - Terminator for completions sent to the fish_pager -*/ -#define COMPLETE_TERMINATOR L'\006' - /** Add a completion. diff --git a/history.c b/history.c index f3d6e799d..36cd54c14 100644 --- a/history.c +++ b/history.c @@ -503,7 +503,8 @@ static void history_populate_from_mmap( history_mode_t *m ) if( (i_orig=hash_get( ¤t_mode->session_item, i ) ) ) { /* - This item comes from this session. Insert the original item at the end of the item list. + This item comes from this session. Insert the + original item at the end of the item list. */ al_push( &session_item_list, i_orig ); } @@ -608,7 +609,8 @@ static void history_save_mode( void *n, history_mode_t *m ) wchar_t *tmp_name; /* - First check if there are any new entries to save. If not, thenm we can just return + First check if there are any new entries to save. If not, then + we can just return */ for( i=0; iitem); i++ ) { @@ -628,7 +630,8 @@ static void history_save_mode( void *n, history_mode_t *m ) signal_block(); /* - Set up on_disk variable to describe the current contents of the history file + Set up on_disk variable to describe the current contents of the + history file */ on_disk = history_create_mode( m->name ); history_load( on_disk ); diff --git a/intern.c b/intern.c index 59fa13562..554635d86 100644 --- a/intern.c +++ b/intern.c @@ -31,6 +31,8 @@ static hash_table_t *intern_static_table=0; const wchar_t *intern( const wchar_t *in ) { const wchar_t *res=0; + +// debug( 0, L"intern %ls", in ); if( !in ) return 0; diff --git a/screen.c b/screen.c index 4c6d0e64d..18e7c5f46 100644 --- a/screen.c +++ b/screen.c @@ -80,6 +80,14 @@ static int try_sequence( char *seq, wchar_t *str ) return 0; } +static int next_tab_stop( int in ) +{ + if( init_tabs <= 0 ) + init_tabs = 8; + + return ( (in/init_tabs)+1 )*init_tabs; +} + /** Calculate the width of the specified prompt. Does some clever magic to detect common escape sequences that may be embeded in a prompt, @@ -184,10 +192,7 @@ static int calc_prompt_width( wchar_t *prompt ) /* Assume tab stops every 8 characters if undefined */ - if( init_tabs <= 0 ) - init_tabs = 8; - - res=( (res/init_tabs)+1 )*init_tabs; + res = next_tab_stop( res ); } else { diff --git a/share/functions/__fish_use_subcommand.fish b/share/functions/__fish_use_subcommand.fish index 3efe1d1eb..1ec2398b1 100644 --- a/share/functions/__fish_use_subcommand.fish +++ b/share/functions/__fish_use_subcommand.fish @@ -1,6 +1,6 @@ function __fish_use_subcommand -d "Test if a non-switch argument has been given in the current commandline" - set -l -- cmd (commandline -poc) + set -l cmd (commandline -poc) set -e cmd[1] for i in $cmd switch $i