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

Evil-mode + company-mode C-n to cycle-through completion is unreliable. #2813

Closed
Kazimazi opened this issue Feb 29, 2020 · 8 comments
Closed

Comments

@Kazimazi
Copy link

Describing the problem

I use C-n and C-p to cycle through completion and it becomes very unreliable.
I'm looking for some assistance how I could go about fixing it.

Since my explanation might not be clear I provide a video.

Expected behavior

Completion menu could be cycled perfectly, just like with M-n and M-p.

Actual behavior

After a few successful steps in the completion menu unexpected letters get into the completion and company pop-up menu eventually closes.

Steps to reproduce the problem

I made a minimal init file which has use-package, evil, company, clojure and cider-modes:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-when-compile
  (require 'use-package))

(use-package evil :ensure t
  :config
  (evil-mode 1))

(use-package company :ensure t
  :demand t
  :bind (("C-SPC" . company-search-candidates)
         :map company-active-map
         ("C-p" . company-select-previous)
         ("C-n" . company-select-next)
         :map company-search-map
         ("C-p" . company-select-previous)
         ("C-n" . company-select-next))
  :init
  (setq company-minimum-prefix-length 1
        company-idle-delay 0.0)
  :config (global-company-mode +1))

(use-package clojure-mode :ensure t :defer t)

(use-package cider :ensure t :defer t)

emacs -q -l .config/emacs/init-minimal.el
Start typing something and press C-n several times.

CIDER version information

;; CIDER 0.25.0snapshot (package: 20200227.1414), nREPL 0.6.0
;; Clojure 1.10.1, Java 1.8.0_222

Lein/Boot version

Leiningen 2.9.1 on Java 1.8.0_222 OpenJDK 64-Bit Server VM

Emacs version

Emacs 28.0.50

Operating system

NixOS 19.09.2166.ce9f1aaa39e (Loris) x86_64

@stale
Copy link

stale bot commented May 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label May 30, 2020
@stale
Copy link

stale bot commented Jun 29, 2020

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Jun 29, 2020
@mizlan
Copy link

mizlan commented May 21, 2021

I have a similar issue where evil thinks I want to symbol completion (evil-complete-next and evil-complete-previous) when a company completion menu is visible.

@chrischambers
Copy link

I have the same issue as @mizlan and @Kazimazi - evil mode, company and cider don't seem to integrate nicely.

Some additional observations:

  • Using ivy instead of orderless/selectrum and friends resolves the problem (presumably because it's not using the default emacs completion operations)
  • I can sometimes get the correct behaviour by waiting for company-box to resolve - i.e. if I issue the commands slowly enough. This seems very inconsistent though: if I lower the company-box popup timer I can't get the company bindings to fire at all, the evil ones always take precedence.

@bbatsov
Copy link
Member

bbatsov commented Sep 12, 2021

I'll reopen the ticket, but as I don't use evil someone else will have to tackle the problem. I'm also not sure if that's some general problem with evil + company, or it's something specific to CIDER. (I know there are some problems with the current company backend that I'll have to fix at some point - #3006) //cc @dgutov

@dgutov
Copy link
Contributor

dgutov commented Sep 12, 2021

If the behavior's different between C-n and M-n key bindings, the problem is likely somewhere in the Evil integration code -- and that resides inside Evil. Not much I could help there with.

If the issue can be reproduced without Evil, let me know.

@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label Mar 30, 2022
@stale
Copy link

stale bot commented Apr 29, 2022

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants