Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: line count imprecision in calclist()



To recreate, run zsh -f in an 80x24, compctl (to load completion modules),
and then the following:

mkdir -p /tmp/xxxxx/yyy/zzzzz
cd /tmp/xxxxx/yyy/zzzzz
touch aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
touch bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
touch cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
touch ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
touch eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
touch fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
touch gggg
touch hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
touch iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
touch jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
touch kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
touch lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
touch mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mkdir ppppppp


You should now have a situation wherein you can type

ls /tmp/xxxxx/yyy/zzzzz/<TAB>

and find your cursor a line too high.  Behavior is normal if no scrolling
occurs.  If you rename the i+ file to something two characters shorter,
the cursor will be two lines too high.

It seems to have something to do with
 	glines += 1 + ((1 + mlens[m->gnum]) / columns);
in calclist() when mlens[m->gnum] is 79 (and therefore glines += 2).


This seems to correct the problem..

--- compresult.c        1999/11/05 09:10:44     1.1.1.3
+++ compresult.c        1999/11/08 03:05:58
@@ -1287,7 +1287,7 @@
                                if (!(m->flags & CMF_DISPLINE))
                                    glines += 1 + (mlens[m->gnum] / columns);
                            } else if (!(m->flags & CMF_NOLIST))
-                               glines += 1 + ((1 + mlens[m->gnum]) / columns);
+                               glines += 1 + ((mlens[m->gnum]) / columns);
                        }
                }
            }

However, it makes me uneasy that something will break elsewhere.



Messages sorted by: Reverse Date, Date, Thread, Author