Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when setting avy-all-windows to t with same buffer displayed in multiple windows #47

Closed
kaushalmodi opened this issue May 18, 2015 · 7 comments

Comments

@kaushalmodi
Copy link

I get the below on calling avy-goto-line with avy-all-windows set to t.

Here I have both windows showing the same buffer. This problem does not happen if the windows are showing different buffers.

You can click on the below image to see it enlarged.

clipboard01

@abo-abo
Copy link
Owner

abo-abo commented May 18, 2015

Can't reproduce, works fine for me.

@kaushalmodi
Copy link
Author

OK, I will then need to understand how one of the avy goto functions works and see what happens differently if the same buffer is shown in both windows vs different buffers in the windows.

I can consistently recreate this problem by taking any buffer and then,

  • C-x 1
  • C-x 3
  • M-x avy-goto-line

The problem does not show up when doing M-x avy-goto-word-1. So it's probably specific to avy-goto-line implementation. The problem did not show up for avy-goto-word-1 because I had its style se to 'pre (as shown below).

Also if this helps, this is the only customization I do for avy:

    (setq avy-style 'at-full)
    (setq avy-styles-alist '((avy-goto-word-1 . pre)))

@kaushalmodi
Copy link
Author

Actually, the problem happens when I set the avy style to 'at-full. The problem went away after I eval'd

(setq avy-style 'pre)

Summary: Problem with any avy command when the same buffer is shown in multiple windows and avy-all-windows is t and that command's style is set to 'at-full.

@abo-abo
Copy link
Owner

abo-abo commented May 18, 2015

OK, I see it now.

abo-abo added a commit that referenced this issue May 18, 2015
* avy.el (avy--overlay-at-full): Update.

Re #47
@abo-abo
Copy link
Owner

abo-abo commented May 18, 2015

This change alleviates the problem slightly. I don't understand why this is happening, could be an Emacs bug.

@kaushalmodi
Copy link
Author

I see that the problem starts happening at the point where we run out of jump shortcuts (avy keys). For example, by default we have 9 keys in avy-keys. The problem triggers after all 2-key combinations are exhausted, after N^2 - N combinations where N is number of keys in avy-keys. I was able to alleviate the problem at least for avy-goto-line (with a 2-window frame config) by increasing the number of keys in avy-keys.

Example:

(setq avy-keys-alist '((avy-goto-line . (?a ?s ?d ?f ?g ?h ?j ?k ?l ?b ?n ?m))))

But the problem returned once I had 4 windows in the frame and there were more lines to index than the number N^2-N

@kaushalmodi
Copy link
Author

Also, from the line where this problem starts occurring, the line contents are shifted to the right even when the style for avy-goto-line is 'at-full.

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

No branches or pull requests

2 participants