mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
New status message for fish_pager
darcs-hash:20060903231209-ac50b-b8bad71cb9194a905918534fafec619118d61e21.gz
This commit is contained in:
parent
40e2025327
commit
9a7be6db08
1 changed files with 5 additions and 6 deletions
11
fish_pager.c
11
fish_pager.c
|
@ -583,14 +583,13 @@ static int completion_try_print( int cols,
|
||||||
*/
|
*/
|
||||||
while(do_loop)
|
while(do_loop)
|
||||||
{
|
{
|
||||||
wchar_t msg[10];
|
wchar_t msg[30];
|
||||||
int percent = 100*pos/(rows-termsize.ws_row+1);
|
int percent = 100*(pos+rows)/(2*rows-termsize.ws_row+1);
|
||||||
set_color( FISH_COLOR_BLACK,
|
set_color( FISH_COLOR_BLACK,
|
||||||
get_color(HIGHLIGHT_PAGER_PROGRESS) );
|
get_color(HIGHLIGHT_PAGER_PROGRESS) );
|
||||||
swprintf( msg, 12,
|
swprintf( msg, 30,
|
||||||
L" %ls(%d%%) \r",
|
L" %d to %d of %d \r",
|
||||||
percent==100?L"":(percent >=10?L" ": L" "),
|
pos, pos+termsize.ws_row-1, rows );
|
||||||
percent );
|
|
||||||
writestr(msg);
|
writestr(msg);
|
||||||
set_color( FISH_COLOR_NORMAL, FISH_COLOR_NORMAL );
|
set_color( FISH_COLOR_NORMAL, FISH_COLOR_NORMAL );
|
||||||
pager_flush();
|
pager_flush();
|
||||||
|
|
Loading…
Reference in a new issue