Open basil-conto opened 5 years ago
This is an artifact of how ivy-completion-in-region
works. If you set (setq ivy-display-functions-alist nil)
, you'll see that f
in the buffer is actually erased, and then it's added to ivy-text
.
It didn't always work like this, previously the buffer was not modified, and ivy-text
started out empty. Maybe it's time to bring that behavior back. Because I find it annoying that I have to type an extra space e.g. f C-M-i SPC col
to get a match, since otherwise ivy-text
will be "fcol" and it will not match fill-column
.
It should be possible to avoid modifying the buffer until a completion has been selected (which is the correct behaviour in any case), whilst simultaneously offering the more convenient initial completion behaviour you describe, by being smarter about how the overlay display property is constructed (I won't have time to look into this for a while). I wonder, though, whether any of the other supported display functions rely on the current behaviour of premature buffer modification.
It should be possible to avoid modifying the buffer until a completion has been selected (which is the correct behaviour in any case)
Yes, this should be fixed eventually.
The current approach was introduced around a year ago in 55e34e887946690a5c8f05403f5fc352c31c3b8d.
The issue was: suppose I'm completing:
(fill|
if the next character is "a", than Ivy will select fillarray
only. But with the old approach, there would be many more candidates, and in addition fill-individual-paragraphs
and not fillarray
would be preselected on input "a".
So if we revert that commit and make the buffer not modified until a completion is selected, we need to make Ivy aware of the completion prefix, and somehow factor it into the preselection logic.
This is a minor annoyance that remains after the crux of #1488 was resolved in commit 7434a792c7b4ace1f138fe4256338e20f49981fc.
make plain
M-:
(setq whitespace-style '(face trailing))
RETM-x
whitespace-mode
RETSPCfC-M-i So far, so good:
M-> Trailing whitespace highlighting kicks in, but only before
ivy-overlay-at
: