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
M-i in counsel-compile fails due to propagated 'cmd property #2040
Comments
AKA (let ((prop (if (get-char-property 0 'cmd cmd) 'cmd 'face)))
(setq cmd (substring-no-properties
cmd 0 (next-single-property-change 0 prop cmd)))) |
@basil-conto that is tighter thanks. Still need to find the best approach to stripping 'cmd off when editing the selected comment though ;-) |
The other thought I had last night was moving all the in/with stuff to a ivy-format-function so the actual text is just the pure call (although still annotated with blddir/bldenv properties). I got halfway through making those changes before I realised this means the search wouldn't include the path/env values in it which is probably useful. |
"M-i" should be equivalent to the user typing out the inserted text, i.e. without text properties. Re #2040
M-i will now insert the text without text properties, since it should simulate the actual input from the user. I don't think it was the intention to pass the text properties before, perhaps an oversight, no code should depend on Please check if this fixes your issue. |
Not quite because in the text string I currently include things like the build dir so the line is of the form:
Where various bits are tagged with different properties. However when executing M-i the user only wants to edit the |
OK, but suppose the user wants to enter the full command manually; M-i is there to facilitate that. Maybe the commands should not be abbreviated, and instead have the full thing as the candidates. |
"M-i" should be equivalent to the user typing out the inserted text, i.e. without text properties. Re abo-abo#2040
https://github.com/abo-abo/swiper/blob/0e62f0d1f61b825ca5eb4b55e47ecb37b3e2834e/counsel.el#L5379+
I've noticed this recently when trying to use compile targets not in the generated list. We fall-over because we look for the cmd property and unless the new target is exactly the same length it will get it wrong. I've thought of something like the following:
i.e. fall-back to searching for the change to the face used for in/with to extract the command. However for this to work I should really strip out the 'cmd property on M-i invocations. So this issue is to discuss what the best approach is. I can think of:
ivy-insert-current
but with special handling(ivy-state-current ivy-last)
somehow - I'm not familiar with how the cl-defstruct stuff works before callingivy-insert-current
ivy-insert-current
can process the text with before inserting the stringSo @abo-abo which do you think is the best approach? Is there already a mechanism for this sort of thing or is my case too much of a special snowflake because of its heavy use of propertised strings?
The text was updated successfully, but these errors were encountered: