-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Bad whitespace-mode highlighting of in-buffer completions #1488
Comments
I just saw the same behaviour in a |
The issue is likely that of two overlay customizations clashing. This is quite common, overlays are a shared resource, but not as transparent as text; I've had a few clashes between It might be possible to fix the issue in |
It's not exactly pretty, but advising (defun fg/with-whitespace-mode-disabled (fn &rest args)
"Call FN with `whitespace-mode' disabled."
(if (member 'whitespace-mode minor-mode-list)
(progn
(whitespace-mode -1)
(apply fn args)
(whitespace-mode 1))
(apply fn args)))
(advice-add 'ivy-completion-in-region :around #'fg/with-whitespace-mode-disabled) I'd love to dig deeper and come up with a proper fix, but my lisp-fu isn't strong enough yet ;) |
@fritzgrabo Thanks for the input. This could be one way of doing it, but it's noticeable by user. Maybe we can figure out something better in time. I'm thinking of something like using |
@abo-abo Thanks for your suggestion. It motivated me read up on a bunch of things :) I found out that
A simple I'm unsure if I want to PR such a change; running command hooks from ivy overlay code seems off? Would you have any thoughts on this? |
Yeah, it's a bit off. But when you think about it, it's pretty good that we have the option to do this. If you think of Emacs as an environment, what we're doing here in Unix terms is making sure two processes cooperate with each other /without/ the first process ( So I suggest you make the PR and we see how ugly the things will get:) |
Note that, just because Ivy has to work around the current workings of |
True, improvements to |
Thanks, please test. |
Thanks, that mostly resolves the issue; I'll submit a new issue for a remaining minor annoyance. |
This is a refactor of the following commit: ivy-overlay.el (ivy-overlay-show-after): Don't inherit existing face 2018-11-27 12:31:32 +0100 7434a79 (ivy--overlay-font-lock-hack): Remove. (ivy-overlay-show-after): Specify default face of ivy-overlay-at to avoid clashing with other overlays. Re: abo-abo#1016, abo-abo#1488, abo-abo#1520, abo-abo#1547, abo-abo#1808
TL;DR
Indented Elisp variable in-buffer completion overlay gets highlighted with
whitespace-trailing
face.Steps to reproduce
make plain
(setq whitespace-style '(face trailing))
RETwhitespace-mode
RETwhitespace-trailing
face.In pictures, all "good" completions:
vs indented variable completion:
I'm not sure with which library (Ivy/Whitespace/Elisp-Mode) the issue lies.
The text was updated successfully, but these errors were encountered: