On 23/7/22 06:27, Alexander F. Rødseth wrote:
For some terminal widths, the "C"/"c" character does not alternate at
regular intervals, but may look like it is stuck at either lowercase or
uppercase.

The previous behavior toggled based on the character position, while this
new behavior toggles the chomp alternation based on the progress percentage 
value.

This leads to slightly improved chomping.


How I would love to remove this option, but I think I would suffer a revolt from users!

This is fine.

Signed-off-by: Alexander F. Rødseth <[email protected]>
---
  src/pacman/callback.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index df4032a4..aa6303bf 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -165,7 +165,7 @@ static void fill_progress(const int percent, const int 
proglen)
                                if(i > hashlen - hash) {
                                        putchar('-');
                                } else if(i == hashlen - hash) {
-                                       if(i % 2 == 0) {
+                                       if(percent % 2 == 0) {
                                                fputs("\033[1;33mC\033[m", 
stdout);
                                        } else {
                                                fputs("\033[1;33mc\033[m", 
stdout);

Reply via email to