-
Notifications
You must be signed in to change notification settings - Fork 258
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
INSERT mode autocomplete by <C-n> only completes the primary selection #949
Comments
I've seen this as well but learned to live with it. It'd be nice to get the same (primary) completion on every selection though. |
The Vis:insert function inserts keys at all cursor positions of active window. I copied few lines from digraph.lua and it is working with multiple selections and also in replace mode. Just replace this line with that: if vis.mode == vis.modes.INSERT then
vis:insert(out)
elseif vis.mode == vis.modes.REPLACE then
vis:replace(out)
end PS: This only works when the prefixes of all selections are the same |
Autocomplete in INSERT mode by <C-n> completes all selections based on the suggestions generated by the input at the primary selection's cursor.
Thank you for the hint, I extended on this in my PR. It will only autocomplete those selections which share the same prefix as the primary selection, the others remain unchanged. I'm not sure if this is a good solution for everyone, but it would work for me. |
Autocomplete in INSERT mode by <C-n> completes all selections based on the suggestions generated by the input at the primary selection's cursor.
Autocomplete in INSERT mode by <C-n> completes all selections based on the suggestions generated by the input at the primary selection's cursor.
Autocomplete in INSERT mode by <C-n> completes all selections based on the suggestions generated by the input at the primary selection's cursor.
Version
commit: 1a958f2 (latest master at this time)
vis -v vis v0.7-29-g1a958f2 +curses +lua +acl
How to reproduce
Only the primary selection will be completed. It's not a big problem, but I would find it more convenient and consistent with other features if the autocompletion would apply to all selections, like pasting. Unlike pasting, I wouldn't have a different autocomplete suggestion for each selection. That's not feasible I think. I would implement it such that the suggestions are generated based on the primary selections cursor. What do you think?
The text was updated successfully, but these errors were encountered: