-
Notifications
You must be signed in to change notification settings - Fork 136
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
How to sync completion changes (Corfu) in Beacon mode? #530
Comments
The beacon mode is a wrapper for keyboard macro, which doesn't work well with operations without deterministic result. The outputs from completions are dynamic, the first option may change on different lines. For such use case, you probably want to do it with query-replace or query-replace-regexp. |
Thanks for the fast reply. I see your point. But, I wonder if we can do something like this (I couldn't get this to work, and it is a little silly, but I think the idea is interesting): (defun corfu-insert-advice (orig-fun &rest args)
(let ((start (point)))
(apply orig-fun args)
(when-let* ((end (point))
(suffix (buffer-substring-no-properties start end)))
(message "completed suffix: %s" suffix)
(delete-region start end)
(insert suffix))))
(advice-add 'corfu-complete :around 'corfu-insert-advice) I'm actually surprised that this doesn't work because I would think the macro should treat the insertion as literal keyboard presses right? Anyway, I guess there's not much to do here, so I'll close the issue, but it's an interesting thought experiment at least... |
A keyboard macro is a sequence of key inputs. So it only tracks your keyboard input as KEYS, not even commands. |
Hi, thanks for all your hard work on this excellent package.
I'm wondering how to apply autocompletions to all the fake cursors in Beacon mode.
For example:
From line 1:
xxGbeiu<tab><esc>
results in(def) (defun)
Is there any way to apply the completion to all cursors in Beacon? I'm using Corfu, but the type of completion probably doesn't matter. I'm using the default config suggested on the Corfu repo.
I am using only the default QWERTY
(meow-setup)
.The text was updated successfully, but these errors were encountered: