abo-abo / avy

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

avy-goto-line doesn't work w/ lines beginning with org-links in org-mode #269

Closed mac230 closed 5 years ago

mac230 commented 5 years ago

Small issue, possibly related to:

https://github.com/abo-abo/avy/issues/261

With org-mode enabled, avy-goto-line doesn't allow you to select lines that begin with a link (although web links work). No such issue in non-org major modes. Simple example below:

some text                                  ;; can select this line
https://github.com/abo-abo/avy/issues/261  ;; can select this line
a link -> [[~/foo.txt][foo]]               ;; can select this line
[[~/foo.txt][foo]]                         ;; can't select this line

Any help much appreciated. Thanks

abo-abo commented 5 years ago

Can't reproduce. Please try with emacs -Q.

mac230 commented 5 years ago

Yep, can't reproduce with emacs -Q. Sorry for not trying that prior to posting.

abo-abo commented 5 years ago

No problem.

mac230 commented 5 years ago

I tracked this to having org-mode and visual-line-mode enabled simultaneously. With one or the other off, avy-goto-line works for org-links at the start of a line.

abo-abo commented 5 years ago

This is due to the (questionable) behavior of line-move-visual:

some text                                  ;; can select this line
https://github.com/abo-abo/avy/issues/261  ;; can select this line
1a link -> [[~/foo.txt][foo]]               ;; can select this line
[[~/foo.txt][2foo]]                         ;; can't select this line

It will move the cursor from 1 to 2, instead to the beginning of the line.

Should be fixed now, thanks.

mac230 commented 5 years ago

Works great; thank you very much for the fix.