abo-abo / avy

Jump to things in Emacs tree-style
1.73k stars 110 forks source link

avy-linum-mode clashes with visual-line-mode #369

Open ghost-of-freedom opened 10 months ago

ghost-of-freedom commented 10 months ago

Avy has hardcoded traversal by screen lines when visual-line-mode is active, but linum marks only logical lines, creating a disparity and producing wrong results when using avy-goto-line with avy-linum-mode and visual-line-mode active (see here for information what screen and logical lines are in this context).

I think this could be easily fixed by checking if avy-linum-mode is off, before we decide to move by screen lines. I'll make the changes and link the pull request here, so you can see if that's an acceptable solution.

By the way, linum-mode has become officially obsolete in Emacs 29 (see here); the recommendation is to use nlinum instead (I'm not even taking display-line-numbers-mode into consideration). Is it something that's easy to replace, or is it a more involved change? At a glance, nlinum exposes a variable that can be set to a function returning string to display on the fringe(?), something that linum seems to have lacked. Do you think that would make it easier to plug in?