Open Adomas-beep-boop-maggots opened 1 year ago
I just noticed that completion highlighting syntax problem only occurs with sly-simple-completions
, which i also observed that with this setting i cannot complete a symbol, of there is single match available. I believe this is not intended behavior.
Also i wish there was a function for sly-complete-symbol-function
which uses completion-styles
set by user, instead of using pre-defined completion functions like sly-complete-symbol-function
and sly-flex-symbol-function
if that makes sense.
im not that good at elisp, but i at tried to fix the highlighting: sly-flex-completions also needs a bit of tweaking
(defun sly-simple-completions (prefix)
"Return (COMPLETIONS COMMON) where COMPLETIONS complete the PREFIX.
COMPLETIONS is a list of propertized strings.
COMMON a string, the common prefix."
(cl-loop with first-difference-pos = (length prefix)
with (completions common) =
(sly--completion-request-completions prefix 'slynk-completion:simple-completions)
for completion in completions
do (let ((diff-pos (1+ first-difference-pos)))
(put-text-property 0
(- diff-pos 1)
'face 'completions-common-part
completion))
do (let ((diff-pos (1+ first-difference-pos)))
(put-text-property first-difference-pos
(min diff-pos (1- (length completion)))
'face 'completions-first-difference
completion))
collect completion into formatted
finally return (list formatted common)))
Submit a patch for the highlighting. Read CONTRIBUTING.md
first.
As for the temp buffer resize mode, it doesn't seem to make anything useful in my testing, so my advice is not to use it. But you could try (setq sly--completion-explanation "")
to see if that improves things. If it does, I guess we can export that variable.
Submit a patch for the highlighting. Read
CONTRIBUTING.md
first.As for the temp buffer resize mode, it doesn't seem to make anything useful in my testing, so my advice is not to use it. But you could try
(setq sly--completion-explanation "")
to see if that improves things. If it does, I guess we can export that variable.
When ill have time ill submit complete fix for sly-simple-completions and sly-flex-completions highlighting. also i want to add separate patch for when using default ui (without sly-symbol-completion-mode). the code should be added which handles completion of longest common denominator, cause right now the completion ui pops up, but you have to type everything manually. Sure completion frameworks that i tried, like corfu, handles the latter case, but i think default completion ui should do it too
Hello, I've tried various settings and the completion UI window is sometimes too small (see 2nd picture) and the highlighting does not match the text that we are trying to complete (see the 1st picture). Note that the 3nd picture is not sly-mode, but i added to illustrate how default emacs completion highlighting should look like
1.![20230509_08h31m52s_grim](https://user-images.githubusercontent.com/62380543/237046127-ba76b178-d514-4975-bd6b-fd284c32a57b.png)
2.![20230509_08h44m46s_grim](https://user-images.githubusercontent.com/62380543/237046143-e985cb07-cd28-4232-9c17-e2542ed2d7a5.png)
3.![20230509_08h48m06s_grim](https://user-images.githubusercontent.com/62380543/237046144-9d0d7b28-bd14-4fc7-9f4d-b73e282475f0.png)