Skip to content
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

Closed

Conversation

duianto
Copy link
Contributor

@duianto duianto commented Oct 18, 2019

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

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.
@duianto duianto mentioned this pull request Oct 18, 2019
@smile13241324
Copy link
Collaborator

Merged 👍

@duianto duianto deleted the fix-c-k-in-company-with-tooltip branch October 19, 2019 17:59
(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))

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...

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

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 list
  • C-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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants