Problem
In lua/codeium/virtual_text.lua
|
local default = config.options.virtual_text.accept_fallback or (vim.fn.pumvisible() == 1 and "<C-N>" or "\t") |
, when
config.options.virtual_text.accept_fallback is nil and there is no completion menu (
pumvisible() == 0), the current fallback behavior inserts a tab character (
"\t"). This is usually not the expected Vim behavior, since users typically expect
<Tab> to trigger mappings or plugin logic, not insert a literal tab character. This can lead to unexpected editing outcomes and breaks common insert mode workflows, especially when
<Tab> is remapped for completion or snippet expansion.
How to Reproduce
- In your Neovim config, explicitly disable windsurf/codeium with:
-- disable codeium by default
require("codeium").disable()
- Open any file for editing.
- Enter insert mode and press Tab.
Result:
You will encounter the error described in #294:
E5108: Error executing lua: ...local/share/nvim2/lazy/nvim-cmp/lua/cmp/utils/keymap.lua:273: "replace_keycodes" requires "expr"
This happens because the fallback returns a tab character ("\t") rather than properly simulating a <Tab> key event, breaking expected plugin and mapping logic.
Proposed Solution
Change the fallback logic so that when accept_fallback is nil, and the completion menu is not visible, fallback returns "<Tab>" instead of "\t". This ensures the correct Vim key event is triggered, supporting user mappings and plugin behaviors as intended.
Relevant Code
local default = config.options.virtual_text.accept_fallback or (vim.fn.pumvisible() == 1 and "<C-N>" or "\t")
Should be updated to:
local default = config.options.virtual_text.accept_fallback or (vim.fn.pumvisible() == 1 and "<C-N>" or "<Tab>")
Problem
In
lua/codeium/virtual_text.luawindsurf.nvim/lua/codeium/virtual_text.lua
Line 140 in 821b570
config.options.virtual_text.accept_fallbackis nil and there is no completion menu (pumvisible() == 0), the current fallback behavior inserts a tab character ("\t"). This is usually not the expected Vim behavior, since users typically expect<Tab>to trigger mappings or plugin logic, not insert a literal tab character. This can lead to unexpected editing outcomes and breaks common insert mode workflows, especially when<Tab>is remapped for completion or snippet expansion.How to Reproduce
Result:
You will encounter the error described in #294:
This happens because the fallback returns a tab character (
"\t") rather than properly simulating a<Tab>key event, breaking expected plugin and mapping logic.Proposed Solution
Change the fallback logic so that when
accept_fallbackis nil, and the completion menu is not visible, fallback returns"<Tab>"instead of"\t". This ensures the correct Vim key event is triggered, supporting user mappings and plugin behaviors as intended.Relevant Code
Should be updated to: