Did you check docs and existing issues?
Neovim version (nvim -v)
0.11.4
Operating system/version
macOS 26.0.1
Describe the bug
When editing a scratch/in-memory buffer, NES throws error:
Error executing vim.schedule lua callback: .../share/nvim/lazy/sidekick.nvim/lua/sidekick/nes/init.lua:200: attempt to get length of a nil value
stack traceback:
.../share/nvim/lazy/sidekick.nvim/lua/sidekick/nes/init.lua:200: in function 'fix_pos'
.../share/nvim/lazy/sidekick.nvim/lua/sidekick/nes/init.lua:187: in function 'handler'
.../neovim/0.11.4/share/nvim/runtime/lua/vim/lsp/client.lua:682: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Steps To Reproduce
- Start neovim:
nvim -u repro.lua
- Set the filetype:
set ft=bash
- Insert
for and accept the snippet
- In the first cursor position, type
foo then hit TAB
- Error message appears
Expected Behavior
NES does not throw error in scratch/in-memory buffers
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "folke/sidekick.nvim", opts = {} },
{
"https://github.com/saghen/blink.cmp",
dependencies = { "https://github.com/rafamadriz/friendly-snippets" },
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
["<Tab>"] = {
"snippet_forward",
function() -- sidekick next edit suggestion
return require("sidekick").nes_jump_or_apply()
end,
-- function() -- if you are using Neovim's native inline completions
-- return vim.lsp.inline_completion.get()
-- end,
"fallback",
},
},
appearance = { nerd_font_variant = "mono" },
completion = {
documentation = { auto_show = false },
list = { selection = { preselect = false, auto_insert = true } },
},
sources = { default = { "lsp", "path", "snippets", "buffer" } },
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
},
{
"https://github.com/neovim/nvim-lspconfig",
event = "VeryLazy",
dependencies = {
{ "https://github.com/saghen/blink.cmp" },
},
config = function()
vim.lsp.set_log_level("OFF")
-- local capabilities = vim.tbl_deep_extend("force", {}, vim.lsp.protocol.make_client_capabilities())
local servers = {
-- misc
bashls = {},
copilot = {},
}
for server_name, server_config in pairs(servers) do
server_config.capabilities = require("blink.cmp").get_lsp_capabilities(server_config.capabilities)
vim.lsp.config(server_name, server_config)
vim.lsp.enable(server_name)
end
end,
},
},
})
Did you check docs and existing issues?
Neovim version (nvim -v)
0.11.4
Operating system/version
macOS 26.0.1
Describe the bug
When editing a scratch/in-memory buffer, NES throws error:
Steps To Reproduce
nvim -u repro.luaset ft=bashforand accept the snippetfoothen hitTABExpected Behavior
NES does not throw error in scratch/in-memory buffers
Repro