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

Incorrect window-start with ivy-avy #1004

Closed
basil-conto opened this Issue May 15, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@basil-conto
Contributor

basil-conto commented May 15, 2017

Steps to reproduce

  1. emacs -Q
  2. M-x package-initialize RET
  3. M-x ivy-mode RET
  4. M-: (ivy-read "Pick a number: " (mapcar #'number-to-string (number-sequence 0 (ash ivy-height 1)))) RET
  5. M->
  6. C-'
  7. Select candidate a
    • Expected result: "12"
    • Actual result: "0"

I believe I have narrowed the problem down to function window-start always returning 1, even when scrolled further down the candidate list. What I find peculiar is that window-end is always correct and (pos-visible-in-window-p (window-start) is always t. I have tried calling redisplay and calling window-end as (window-end nil t) before calling window-start but the result is always the same.

@abo-abo abo-abo closed this in 97e9205 May 16, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented May 16, 2017

Thanks for catching this. Please test.

@basil-conto

This comment has been minimized.

Contributor

basil-conto commented May 21, 2017

Thank you for tending to this. I do not, however, think the problem is completely fixed. Although the correct candidate is selected now, the string returned by ivy-read includes the surrounding formatting context.

Adjusting my previous steps to reproduce:

  1. emacs -Q
  2. M-x package-initialize RET
  3. M-x ivy-mode RET
  4. M-: (setq ivy-format-function #'ivy-format-function-arrow) RET
  5. M-: (ivy-read "Pick a number: " (mapcar #'number-to-string (number-sequence 0 (ash ivy-height 1)))) RET
  6. M->
  7. C-'
  8. Select candidate a
    • Expected result: "12"
    • Actual result: " 12"

@abo-abo abo-abo reopened this May 22, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented May 22, 2017

Reopening. PRs welcome.

@basil-conto

This comment has been minimized.

Contributor

basil-conto commented May 22, 2017

I'd like to investigate further but I don't expect to make much progress over the next month or two (I also need to submit a copyright assignment).

@abo-abo

This comment has been minimized.

Owner

abo-abo commented May 22, 2017

No problem, take your time.

@suryaaditya

This comment has been minimized.

suryaaditya commented Jul 20, 2017

hi, not sure if this behavior observed is related to this issue:
Steps:

  1. counsel-find-file
  2. C-'(ivy-avy)
  3. instead of the opening the file selected, it tries to open a brand new buffer.

C-' (ivy-avy) works as expected on commands like Counsel-M-x though and also works as expected on command 'find-file' C-xC-f.

@ryankask

This comment has been minimized.

ryankask commented Jul 27, 2017

I'm seeing the same behaviour as @suryaaditya although it doesn't appear to work anywhere for me. For example, with counsel-M-x I see apply: Wrong type argument: commandp, \ \ apropos.

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Jul 27, 2017

@suryaaditya Your example works fine on my system. Please try to reproduce with emacs -Q (or use make plain from this repo).

@ryankask

This comment has been minimized.

ryankask commented Aug 2, 2017

@abo-abo I've taken up your suggestion and can reproduce the issue with the following setting:

(setq ivy-format-function 'ivy-format-function-arrow)

@abo-abo abo-abo closed this in 75c873b Aug 2, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Aug 2, 2017

@ryankask Thanks. It's easy to fix once it's reproducible.

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