-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix C-k in company with tooltip #12845
Conversation
Got the idea for the fix from this comment: company-mode/company-quickhelp#17 (comment) I simplified it to only un/define C-k, since C-j worked without the fix.
Merged 👍 |
(defun spacemacs//set-C-k-company-select-previous (&rest args) | ||
(define-key evil-insert-state-map (kbd "C-k") 'company-select-previous)) | ||
(defun spacemacs//restore-C-k-evil-insert-digraph (&rest args) | ||
(define-key evil-insert-state-map (kbd "C-k") 'evil-insert-digraph)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's really a stupid change...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yzprofile Do you have a suggestion for a better solution?
This is the issue it's trying to fix:
Completion: C-k not working consistently #2974
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean do not override C-k
in company-completion-finished-hook
and company-completion-cancelled-hook
or make it as optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's more descriptive. A tip for future comments, add more details in the first comment:
This is stupid...
Because...
😄
This is what I'm seeing with:
(auto-completion :variables auto-completion-enable-help-tooltip t)
Without this change.
- On an empty line in
.spacemacs
- Type
dot
Now a drop down list (company-mode) opens with suggestions.
Before a tooltip has appeared
C-j
moves down in the listC-k
moves up in the list
When the tooltip has appeared, then C-k
inserts ?
(it called evil-insert-digraph
).
It waits for two key presses, for example: if one types 12
then it inserts the character: ½
With this change
C-k
continues to navigate up in the list after the tooltip has been shown.
To insert a digraph character with C-k
, the drop down list has to be closed first with C-g
.
Could you explain what your observing and expecting.
And include your system info (SPC h d s
copies it to your clipboard).
Got the idea for the fix from this comment:
company-mode/company-quickhelp#17 (comment)
I simplified it to only un/define C-k, since C-j worked without the fix.
Fixes #2974