abo-abo / avy

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

[Feature Request] Show goto line overlay next to the first non whitespace character on the line #243

Closed lane-s closed 6 years ago

lane-s commented 6 years ago

This is pretty self-explanatory from the title. Usually when I go to a line, I'm looking at the text on the line rather than all the way to the left side of the buffer where the overlay is displayed. I'm willing to hack on this, so I'll give it a go soon and report back.

This would be available as a configuration variable rather than the default.

abo-abo commented 6 years ago

It's pretty easy to do, patch avy--line-cands:

-(if (eq avy-style 'post)
-    (line-end-position)
-  (point))

+(if (eq avy-style 'post)
+    (line-end-position)
+  (save-excursion
+    (skip-chars-forward " \t")
+    (point)))

Please add a documented defcustom and PR.

lane-s commented 6 years ago

Added in fd7b9297191ebcd630310cdff7e78698eb81495c