Skip to content

Conversation

@smolck
Copy link
Contributor

@smolck smolck commented Feb 4, 2021

No description provided.

@bfredl
Copy link
Member

bfredl commented Feb 4, 2021

cool, maybe a test? :)

@smolck smolck requested a review from bfredl February 4, 2021 15:22
@smolck smolck requested a review from bfredl March 9, 2021 22:02
@bfredl bfredl merged commit e355cc8 into neovim:master Mar 9, 2021
@kassio
Copy link

kassio commented Mar 9, 2021

Sharing just because more people might face the same problem I'm having.

This commit broke quite a few plugins I use. Based on the error: E5108: Error executing lua vim.lua:269: Tried to call API function with vim.fn: use vim.api.nvim_create_buf instead I found bugs on (not exhaustive list)

  • plenary.nvim
  • nvim-lspconfig
  • popup.nvim

Given that plenary and popup are base for other plugins I imagine a bigger impact.

grep command
$ rg 'fn.nvim_create_buf'
site/pack/packer/start/telescope.nvim/lua/telescope/builtin/internal.lua
320:        -- local buf = vim.fn.nvim_create_buf(false, true)

site/pack/packer/start/plenary.nvim/scratch/window_test.lua
8:  local bufnr = vim.fn.nvim_create_buf(false, true)
20:  buf_text = vim.fn.nvim_create_buf(false, true)
22:  buf_border = vim.fn.nvim_create_buf(false, true)

site/pack/packer/start/plenary.nvim/lua/plenary/popup.lua
37:    bufnr = vim.fn.nvim_create_buf(false, true)

site/pack/packer/start/plenary.nvim/lua/plenary/window/float.lua
50:  local bufnr = options.bufnr or vim.fn.nvim_create_buf(false, true)
91:  local primary_bufnr = vim.fn.nvim_create_buf(false, true)
178:  local bufnr = options.bufnr or vim.fn.nvim_create_buf(false, true)

site/pack/packer/start/nvim-lspconfig/lua/lspconfig/_lspui.lua
94:  local bufnr = options.bufnr or vim.fn.nvim_create_buf(false, true)

site/pack/packer/start/popup.nvim/lua/popup/init.lua
38:    bufnr = vim.fn.nvim_create_buf(false, true)

I'm not sure how to proceed, again, just want to share what I'm experiencing.

@smolck
Copy link
Contributor Author

smolck commented Mar 10, 2021

@kassio Since plugins had the freedom to be inconsistent in the usage of vim.fn versus vim.api (e.g. they could use vim.fn.nvim_create_buf or vim.api.nvim_create_buf) and this PR enforces the usage of vim.api over vim.fn in cases where vim.api can be used, there will probably be multiple plugins that break for nightly/master users.

Thankfully, the fix for these errors is pretty trivial/straightforward, such that any broken plugins should be able to be fixed fairly quickly; at the very least, I was able to open PRs on the repositories you mentioned to fix the errors in those places (the one on nvim-lspconfig has already been merged).

iwata added a commit to iwata/neovim that referenced this pull request Mar 10, 2021
VVKot added a commit to VVKot/nvim-lightbulb that referenced this pull request Mar 13, 2021
VVKot added a commit to VVKot/plenary.nvim that referenced this pull request Mar 13, 2021
See neovim/neovim#13875. Switching over the commented out code so that we don't face troubles when uncommenting it
VVKot added a commit to VVKot/express_line.nvim that referenced this pull request Mar 13, 2021
VVKot added a commit to VVKot/telescope.nvim that referenced this pull request Mar 13, 2021
@kkharji
Copy link

kkharji commented Mar 14, 2021

:/ this is THE WORST PR ever. Seriously!!!! like wtf. I know it's the right move and I totally agree with the reasons given. But it broke everything! There should've been some type of announcement, coordination with other authors, or something before merge.

NO HARD FEELINGS!

kkharji pushed a commit to nvim-telescope/telescope.nvim that referenced this pull request Mar 14, 2021
@bfredl
Copy link
Member

bfredl commented Mar 14, 2021

We did change our routines for breaking changes after this. Now there is this issue #14090 you can subscribe to for breaking changes, replacing the old wiki page (as apparently you cannot "follow" a github wiki page).

iwata added a commit to iwata/neovim that referenced this pull request Mar 24, 2021
iwata added a commit to iwata/neovim that referenced this pull request Mar 25, 2021
tjdevries pushed a commit to nvim-lua/plenary.nvim that referenced this pull request Mar 28, 2021
See neovim/neovim#13875. Switching over the commented out code so that we don't face troubles when uncommenting it
delphinus pushed a commit to delphinus/plenary.nvim that referenced this pull request Apr 26, 2021
See neovim/neovim#13875. Switching over the commented out code so that we don't face troubles when uncommenting it
@smolck smolck deleted the vim_fn_error_on_api branch October 10, 2021 17:28
@clason clason mentioned this pull request May 4, 2022
@dundargoc dundargoc removed the request for review from bfredl May 19, 2022 08:32
LuizCalaa added a commit to LuizCalaa/telescope.nvim that referenced this pull request Mar 17, 2023
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.

4 participants