abo-abo / avy

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

Reverse the order of key-labels for "above" commands [#342] #343

Open MicahElliott opened 2 years ago

MicahElliott commented 2 years ago

Let's say I have a window showing many (200) lines. Point is somewhere in the middle or bottom of the screen. I want to jump up say 5 lines. Avy was optimized to jump most easily way up to the top of the window rather than 5 lines up. To go upward, I almost always ended up typing two prompt chars.

With the "above" cases for this commit, the order is now reversed, going up 5 lines will always just require typing a single char to jump. I feel that this should be the default behavior for the "above" commands. Isn't it most common to do shorter jumps

sivaplaysmC commented 1 year ago
(defun my-avy-goto-line-above (&optional offset bottom-up)
  "Goto visible line above the cursor.
OFFSET changes the distance between the closest key to the cursor and
the cursor
When ***BOTTOM-UP*** is non-nil, display avy candidates from top to bottom"
sivaplaysmC commented 1 year ago

@MicahElliott you can pass the bottom up arguement , no need to rewrite avy tree please close this PR

MicahElliott commented 1 year ago

Thanks @sivaplaysmC, that's nice to see there's some bottom-up options in avy . But I'm particularly looking for avy-goto-symbol-1-above to be able do bottom-up, and I don't see any of the symbol/word functions having support for it. Do you see a way to do it?