Skip to content

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

Open
MicahElliott wants to merge 1 commit into
abo-abo:masterfrom
MicahElliott:mde-342
Open

Reverse the order of key-labels for "above" commands [#342]#343
MicahElliott wants to merge 1 commit into
abo-abo:masterfrom
MicahElliott:mde-342

Conversation

@MicahElliott
Copy link
Copy Markdown

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

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
Copy link
Copy Markdown

sivaplaysmC commented May 18, 2023

(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
Copy link
Copy Markdown

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

@MicahElliott
Copy link
Copy Markdown
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants