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

Completion is auto selected when omni source is used #8

Closed
wangl-cc opened this issue Nov 22, 2022 · 8 comments
Closed

Completion is auto selected when omni source is used #8

wangl-cc opened this issue Nov 22, 2022 · 8 comments

Comments

@wangl-cc
Copy link

Sorry about my bad description. More about this issue, please have a look at the screen recording. When I type a character, then a completion is selected immediately, and also there are two popup.

2022-11-22.17.15.48.mov

Minimal init.lua to Reproduce this issue:

require("packer").startup({
  {
    "wbthomason/packer.nvim",
    "hrsh7th/nvim-cmp",
    "hrsh7th/cmp-nvim-lsp",
    "hrsh7th/cmp-omni",
    "neovim/nvim-lspconfig",
  },
})

local cmp = require("cmp")
local cmp_lsp = require("cmp_nvim_lsp")
local lspconfig = require("lspconfig")
lspconfig.sumneko_lua.setup {
  cmd = { "lua-language-server" },
  settings = {
    Lua = {
      telemetry = { enable = false },
    },
  },
  capabilities = cmp_lsp.default_capabilities(),
}
cmp.setup {
  sources = cmp.config.sources({
    { name = "nvim_lsp" },
  }, {
    { name = "omni" },
  })
}
@liuyuzhenn
Copy link

I have the issue

@Coadon
Copy link

Coadon commented Jan 16, 2023

Same issue here, pretty annoying.

@kwand
Copy link

kwand commented Mar 14, 2023

It seems I also have the same issue (and it's very annoying).

I only installed this since vimtex recommended it to allow its snippets to be visible here, but clearly, I need to look for another solution (or spend some time debugging this).

@bstaint
Copy link

bstaint commented Mar 14, 2023

It's conflict with nvim_lsp, temporary solution.

local on_attach = function(client, bufnr)
  -- https://github.com/neovim/neovim/pull/19677
  -- https://github.com/hrsh7th/cmp-omni/commit/01f0f66e7dc227606bb8d8ffad688b9c393a052c
  vim.api.nvim_buf_set_option(bufnr, "omnifunc", "any non-empty character")
end

@p00f
Copy link

p00f commented Mar 14, 2023

@bstaint It happens in python's omnifunc and I don't have lsp configured for python

@kwand
Copy link

kwand commented Mar 22, 2023

@hrsh7th Any idea what is causing this issue (and if it indeed due to nvim_lsp conflicts whether some note should be made about this in the README itself?)

I believe you worked with @lervag over at the vimtex when they were implementing support for nvim-cmp via omni? (I see some commits on this repo were made due to issues discussed over at vimtex). Is this a new issue, or did it happen before?

@cnrrobertson
Copy link

I think the autoselection can be avoided with the vim setting vim.opt.completeopt:append('noselect') but the multiple popups are still unresolved

@keiwanjamaly
Copy link

It's conflict with nvim_lsp, temporary solution.

local on_attach = function(client, bufnr)
  -- https://github.com/neovim/neovim/pull/19677
  -- https://github.com/hrsh7th/cmp-omni/commit/01f0f66e7dc227606bb8d8ffad688b9c393a052c
  vim.api.nvim_buf_set_option(bufnr, "omnifunc", "any non-empty character")
end

@bstaint Since this is already open for a while, what have you done with on_attach?

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

No branches or pull requests

8 participants