abo-abo / avy

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

Fix abo-abo/avy#369 #370

Open ghost-of-freedom opened 10 months ago

ghost-of-freedom commented 10 months ago

Avy uses screen lines when visual-line-mode is active, but linum marks only logical lines, so the indicators do not match the actual characters avy will use to jump, when both visual-line-mode and avy-linum-mode is active. We're taking linum's side here, and not using the visual-line code branches in avy when avy-linum-mode is active. It would be nice if linum could be forced to accept avy's reality instead, perhaps having an option to choose which side to take with a variable, but unfortunately I didn't find anything that would suggest such configuration could be possible, neither in linum, nor in nlinum for that matter. I also wrapped one naked visual-line-mode condition in a (bound-and-true-p) for consistency; I'm not sure if that change is necessary, and it can be reverted in case of trouble.