Minor refactoring and fixed a bug in history function

This commit is contained in:
Siteshwar Vashisht 2012-07-24 04:35:37 +05:30
parent 81e0342bf6
commit 32d2d0f0d0
3 changed files with 5 additions and 17 deletions

View file

@ -875,6 +875,10 @@ void s_write( screen_t *s,
truncated_autosuggestion_line.push_back(ellipsis_char);
commandline = truncated_autosuggestion_line.c_str();
}
for( i=0; i<prompt_width; i++ )
{
s_desired_append_char( s, L' ', 0, 0, prompt_width );
}
/*
If overflowing, give the prompt its own line to improve the
@ -882,23 +886,9 @@ void s_write( screen_t *s,
*/
if( max_line_width + prompt_width >= screen_width )
{
for( i=0; i<prompt_width; i++ )
{
s_desired_append_char( s, L' ', 0, 0, prompt_width );
}
s_desired_append_char( s, L'\n', 0, 0, 0 );
prompt_width=0;
}
else
{
for( i=0; i<prompt_width; i++ )
{
s_desired_append_char( s, L' ', 0, 0, prompt_width );
}
}
for( i=0; commandline[i]; i++ )
{

View file

@ -84,6 +84,6 @@ function funced --description 'Edit function definition'
. $tmpname
end
set -l stat $status
rm $tmpname >/dev/null
rm -f $tmpname >/dev/null
return $stat
end

View file

@ -100,14 +100,12 @@ function history --description "Deletes an item from history"
builtin history --delete $item
end
printf "Deleted all!\n"
return
else
builtin history --delete $found_items[(math $i - 1)]
end
end
end
#Save changes after deleting item(s)
builtin history --save
end