jacktasia / dumb-jump

an Emacs "jump to definition" package for 50+ languages
GNU General Public License v3.0
1.57k stars 150 forks source link

Popup should limit the number of rows to match available vertical space #332

Open wavexx opened 4 years ago

wavexx commented 4 years ago

When I use dumb-jump on a frame which has been split horizontally and call dj on a function which returns lots of definitions, the popup often extends beyond the visible buffer. This makes scrolling through results impossible, since either the top-most or bottom-most rows are hidden.

To reproduce just split or resize the frame until the buffer can display 10 lines, then attempt to jump to any C macro ;)

He's just an exaggerated screenshot:

2020-04-09T210043

more than half of the results cannot be seen even when scrolling.

dumb-jump should perhaps limit the number of rows in the pop-up to match the number of visible lines in the buffer. When that happens, it's also preferable that the popup vertical position is sacrificed to start on whatever row is closest in order to show more results (up to the number of vertical lines), instead of just showing 4-5.

Similarly, horizontal position could be improved when the point is far right on the frame, but I had less issues with it.

jacktasia commented 4 years ago

Thanks for opening this. I agree this is a flaw with using popup, which is mainly still the default because of backward compatibility.

I would still like to fix this, but I think most people just end up using ivy or helm, which don't have this problem.

(setq dumb-jump-selector 'ivy)