avy icon indicating copy to clipboard operation
avy copied to clipboard

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

Open MicahElliott opened this issue 3 years ago • 3 comments

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

MicahElliott avatar Mar 02 '22 21:03 MicahElliott

(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 avatar May 18 '23 07:05 sivaplaysmC

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

sivaplaysmC avatar May 18 '23 07:05 sivaplaysmC

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?

MicahElliott avatar May 18 '23 13:05 MicahElliott