nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

Announcement: Breaking changes

Open hrsh7th opened this issue 3 years ago • 8 comments

hrsh7th avatar Sep 21 '21 10:09 hrsh7th

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 avatar Sep 21 '21 10:09 hrsh7th

SourceConfig.opts is deprecated https://github.com/hrsh7th/nvim-cmp/pull/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 avatar Nov 22 '21 08:11 hrsh7th

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 avatar Dec 14 '21 13:12 hrsh7th

The cmp#ready autocmd renamed to CmpReady

autocmd User cmp#ready ...

↓↓↓

autocmd User CmpReady ...

hrsh7th avatar Dec 26 '21 05:12 hrsh7th

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

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

↓↓↓

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

hrsh7th avatar Feb 11 '22 06:02 hrsh7th

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 avatar Apr 13 '22 14:04 hrsh7th

Remove all default key mappings (workaround is existing)

All key mappings have been removed by https://github.com/hrsh7th/nvim-cmp/commit/93cf84f7deb2bdb640ffbb1d2f8d6d412a7aa558.

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

}

hrsh7th avatar Apr 13 '22 15:04 hrsh7th

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

  • https://github.com/hrsh7th/nvim-cmp/pull/956
  • https://github.com/hrsh7th/nvim-cmp/pull/844
  • https://github.com/hrsh7th/nvim-cmp/pull/922

hrsh7th avatar Apr 19 '22 17:04 hrsh7th

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.

hrsh7th avatar May 25 '23 17:05 hrsh7th