diff options
Diffstat (limited to 'pager.c')
-rw-r--r-- | pager.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -73,7 +73,7 @@ void setup_pager(void) { const char *pager = git_pager(isatty(1)); - if (!pager) + if (!pager || pager_in_use()) return; /* @@ -147,3 +147,15 @@ int term_columns(void) return term_columns_at_startup; } + +/* + * How many columns do we need to show this number in decimal? + */ +int decimal_width(int number) +{ + int i, width; + + for (width = 1, i = 10; i <= number; width++) + i *= 10; + return width; +} |