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

Weird interaction with ivy-mode and js-mode #528

Closed
bsuh opened this issue Jun 1, 2016 · 11 comments
Closed

Weird interaction with ivy-mode and js-mode #528

bsuh opened this issue Jun 1, 2016 · 11 comments

Comments

@bsuh
Copy link

@bsuh bsuh commented Jun 1, 2016

Here's a video of it https://youtu.be/1l9FWjP6ass

  1. Download this Javascript file https://code.jquery.com/jquery-1.12.4.js
  2. Install ivy
  3. Enable ivy-mode
  4. Open jquery file
  5. Start a Lisp eval and type in "(setq-default js-indent-le", press TAB, it completes correctly to js-indent-level
  6. Scroll down
  7. Start a Lisp eval and type in "(setq-default js-indent-le", press TAB, it completes incorrectly to js-indent-lejs-indent-level
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Jun 2, 2016

I can't reproduce on Emacs 25. What's your Emacs version?

@bsuh
Copy link
Author

@bsuh bsuh commented Jun 2, 2016

GNU Emacs 24.5.1 (x86_64-apple-darwin15.4.0, Carbon Version 157 AppKit 1404.46)
 of 2016-05-08 on Brians-MacBook-Pro.local
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Jun 2, 2016

Can you reliably reproduce this bug each time? I recall getting it a few times on extremely slow hardware (shared remote system, huge ping). But I don't remember this happening on any reasonably fast system.

@bsuh
Copy link
Author

@bsuh bsuh commented Jun 2, 2016

image

I reproduce it 100% after scrolling. The file is on my local filesystem.

@bsuh
Copy link
Author

@bsuh bsuh commented Jun 2, 2016

Interestingly enough I can't reproduce on emacs 24.5.1 running on Ubuntu.

@abo-abo abo-abo closed this in db94a12 Jun 2, 2016
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Jun 2, 2016

Thanks for the detailed report. For some reason, I could not reproduce it on my config. But with emacs-24.5 -Q indeed I was able to reproduce. Please check.

@bsuh
Copy link
Author

@bsuh bsuh commented Jun 2, 2016

It is working correctly for me now. Thanks for the quick fix. :)

@ghost
Copy link

@ghost ghost commented Jun 4, 2016

The fix for this issue removes the prefix on completion:

In M-x shell:

$ tree
.
└── directory
    └── file

2 directories, 1 file
$ ls directory/fi<TAB>    (->)
$ ls file

I'm not able to reproduce the original issue here, so not sure what a better fix might be.

abo-abo added a commit that referenced this issue Jun 5, 2016
This reverts commit db94a12.

Re #528
abo-abo added a commit that referenced this issue Jun 5, 2016
The argument passed to `ivy-completion-common-length' looked like:

    ("js-indent-level"
     0 12 (font-lock-face
           completions-common-part)
     12 13 (font-lock-face
            completions-first-difference))

Note the `font-lock-face' property instead of the `face' property that
`ivy-completion-common-length' expected. The function now works with
both types.

Fixes #528
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Jun 5, 2016

@thwg, thanks. I'm reverting the previous commit.

@bsuh, please test the new fix.

@bsuh
Copy link
Author

@bsuh bsuh commented Jun 5, 2016

@abo-abo The new fix is still working correctly for me.

@bsuh
Copy link
Author

@bsuh bsuh commented Jun 7, 2016

@abo-abo Ran into another bug now.

  1. Open emacs
  2. Start Lisp eval and type in (setq-local tab-indent and then press TAB
  3. Completes to (setqtab-always-indent
abo-abo added a commit that referenced this issue Jun 7, 2016
Example: (setq tab-indent) completes to `tab-always-indent' which has
'completion-common-length property longer than the original string.

Re #528
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants