You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I type fori in lua. My completion menu looks like this:
I then select the next entry and the i disappears:
I then select the previous entry (the original) and the i is inserted, but the cursor is not moved, so the i is after the cursor:
I then accept the completion. The i remains inserted after the snippet:
auto_insert and preselect are enabled, as per default.
This might be a duplicate of #810, but I'm not sure.
-- Run with `nvim -u repro.lua`vim.env.LAZY_STDPATH='.repro'load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
---@diagnosticdisable-next-line:missing-fieldsrequire('lazy.minit').repro({
spec= {
{
'saghen/blink.cmp',
build='cargo build --release',
opts= {
keymap= { preset='enter', cmdline= { preset='default' } },
},
},
{
'neovim/nvim-lspconfig',
dependencies= {
-- for installing lua_ls. for whatever reason this doesn't work the first time. so close and reopen `nvim -u repro.lua`-- or run :MasonInstall lua-language-server
{ 'williamboman/mason.nvim', opts= {} },
{ 'williamboman/mason-lspconfig.nvim', opts= { ensure_installed= {"lua_ls"} } },
},
opts= {
servers= {
lua_ls= {},
},
},
config=function(_, opts)
locallspconfig=require('lspconfig')
forserver, configinpairs(opts.servers) do-- passing config.capabilities to blink.cmp merges with the capabilities in your-- `opts[server].capabilities, if you've defined itconfig.capabilities=require('blink.cmp').get_lsp_capabilities()
lspconfig[server].setup(config)
endend,
},
},
})
Rather than the concept of undo, how about remembering the context (line content, etc) when the request was sent, so we can restore the content when selection is changed, and treat each new auto_insert stateless.
#810 can also be solved by this approach, the cause is that su is not cleared by undo_preview's logic, as list.preview_undo.text_edit is not updated when user keeps typing, only when selection is changed.
Make sure you have done the following
blink.cmp
<C-k>
on https://cmp.saghen.dev)Bug Description
Say I type
fori
in lua. My completion menu looks like this:I then select the next entry and the
i
disappears:I then select the previous entry (the original) and the
i
is inserted, but the cursor is not moved, so thei
is after the cursor:I then accept the completion. The
i
remains inserted after the snippet:auto_insert
andpreselect
are enabled, as per default.This might be a duplicate of #810, but I'm not sure.
Relevant configuration
neovim
versionNVIM v0.11.0-dev+1493-g4d9405991 Build type: RelWithDebInfo LuaJIT 2.1.1720049189
blink.cmp
versionmain
The text was updated successfully, but these errors were encountered: