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

Announcement: Breaking changes #231

Open
hrsh7th opened this issue Sep 21, 2021 · 9 comments
Open

Announcement: Breaking changes #231

hrsh7th opened this issue Sep 21, 2021 · 9 comments

Comments

@hrsh7th
Copy link
Owner

hrsh7th commented Sep 21, 2021

No description provided.

@hrsh7th hrsh7th pinned this issue Sep 21, 2021
@hrsh7th
Copy link
Owner Author

hrsh7th commented Sep 21, 2021

Use floating window instead of native menu #224

The user must change the configuration as the following.

Change feeding <C-n>/<C-p> and vim.fn.pumvisible() == check

You should change the configuration.

cmp.setup {
  mapping = {
    ['<Tab>'] = function(fallback)
      if vim.fn.pumvisible() == 1 then
        vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), true)
      else
        fallback()
      end
    end
  }
}

↓↓↓

cmp.setup {
  mapping = {
    ['<Tab>'] = function(fallback)
      if cmp.visible() then
        cmp.select_next_item()
      else
        fallback()
      end
    end
  }
}

@hrsh7th hrsh7th changed the title Breaking changes Announcement: Breaking changes Sep 21, 2021
@hrsh7th hrsh7th closed this as completed Sep 22, 2021
@hrsh7th hrsh7th reopened this Sep 22, 2021
Repository owner locked and limited conversation to collaborators Sep 25, 2021
Repository owner deleted a comment from windwp Sep 25, 2021
Repository owner deleted a comment from gegoune Sep 25, 2021
Repository owner deleted a comment from vuki656 Sep 25, 2021
Repository owner deleted a comment from pocco81 Sep 25, 2021
@hrsh7th
Copy link
Owner Author

hrsh7th commented Nov 22, 2021

SourceConfig.opts is deprecated #561

cmp.setup {
  sources = {
    {
      name = 'buffer',
      opts = {
        get_bufnrs = function() return { vim.api.nvim_get_current_buf() } end
      }
    }
  }
}

↓↓↓

cmp.setup {
  sources = {
    {
      name = 'buffer',
      option = {
        get_bufnrs = function() return { vim.api.nvim_get_current_buf() } end
      }
    }
  }
}

@hrsh7th
Copy link
Owner Author

hrsh7th commented Dec 14, 2021

The cmp.complete arguments was changed

cmp.setup {
  mapping = {
    ['<C-x><C-s>'] = cmp.mapping.complete({
      sources = {
        { name = 'vsnip' }
      }
    }),
  }
}

↓↓↓

cmp.setup {
  mapping = {
    ['<C-x><C-s>'] = cmp.mapping.complete({
      config = {
        sources = {
          { name = 'vsnip' }
        }
      }
    }),
  }
}

@hrsh7th
Copy link
Owner Author

hrsh7th commented Dec 26, 2021

The cmp#ready autocmd renamed to CmpReady

autocmd User cmp#ready ...

↓↓↓

autocmd User CmpReady ...

@hrsh7th
Copy link
Owner Author

hrsh7th commented Feb 11, 2022

Remove experimental.native_menu and add view.entries = 'native' instead.

cmp.setup {
   ...
  experimental = {
    native_menu = true
  }
  ...
}

↓↓↓

cmp.setup {
   ...
  view = {
    entries = 'native'
  }
  ...
}

@hrsh7th
Copy link
Owner Author

hrsh7th commented Apr 13, 2022

Remove documentation and add window.documentation instead.

cmp.setup {
   ...
  documentation = false,
  ...
}

↓↓↓

cmp.setup {
   ...
  window = {
    documentation = false,
  }
  ...
}

NOTE: I'm planning the window configuration option will be deprecated. I think it should be merged to view configuration option.

@hrsh7th
Copy link
Owner Author

hrsh7th commented Apr 13, 2022

Remove all default key mappings (workaround is existing)

All key mappings have been removed by 93cf84f.

If you want to achieve the previous behavior, you can use the built-in helper as below.

cmp.setup {
  ...
  mapping = cmp.mapping.preset.insert({
    -- Your configuration here.
  })
  ...
}

cmp.setup.cmdline {
  ...
  mapping = cmp.mapping.preset.cmdline({
    -- Your configuration here.
  })
  ...

}

tarebyte added a commit to tarebyte/dotfiles that referenced this issue Apr 18, 2022
@hrsh7th
Copy link
Owner Author

hrsh7th commented Apr 19, 2022

nvim-cmp will only work on nvim v0.7.x or higher.

status: applied

The nvim v0.7.0 contains the Lua version APIs.
So nvim-cmp will use it and drop supporting the previous version of nvim.

  1. vim.api.nvim_create_autocmd
  2. vim.api.nvim_set_hl
  3. vim.api.nvim_create_user_command

Related

@hrsh7th
Copy link
Owner Author

hrsh7th commented May 25, 2023

source[n].max_item_count is removed

This is minor breaking change.
The source[n].max_item_count is now removed.

Now performance.max_view_entries can be used for performance.

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

No branches or pull requests

1 participant