-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
This is re-opening of #270
oxide-bug.mp4
Steps to reproduce
- two files,
A.mdandB.md - type in
[[B]]in theA.mdfile - trigger completion after the
Bcharacter ([[B<here trigger>]]) - select the offered
Bcompletion - See the closing brackets duplicated
]]]]
Expected behaviour
only one pair of brackets shows
Actual behaviour
duplicated brackets
Root cause
When we provide completion, we always end the wikilink replacement text with ]] regardless of the line content
It's possible that nvim-cmp somehow handles this, but simple completion plugins don't.
Minimum reproduction scenario
Create an empty directory (e.g. test), and the following script in the directory and run it
#!/bin/bash
## Heavily inspired by https://github.com/folke/lazy.nvim/wiki/Minimal-%60init.lua%60-to-Reproduce-an-Issue
# Clean up previous runs
rm -rf .repro A.md B.md
# Create directory structure
mkdir -p .repro/plugins/start
# Download plugins
echo "📦 Downloading plugins..."
git clone --quiet --depth=1 https://github.com/neovim/nvim-lspconfig.git .repro/plugins/start/nvim-lspconfig
git clone --quiet --depth=1 https://github.com/echasnovski/mini.completion.git .repro/plugins/start/mini.completion
# Create repro.lua for instant minimal environment
cat > repro.lua << 'EOF'
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- Setup plugins
require('mini.completion').setup()
require('lspconfig').markdown_oxide.setup({
-- cmd = {vim.fn.expand('~/path/to/markdown-oxide')}, -- Uncomment to use custom binary
})
vim.keymap.set('i', '<C-Space>', '<C-x><C-u>')
EOF
# Create test files
cat > A.md << 'EOF'
# Test File A
Link to B: [[B]]
EOF
cat > B.md << 'EOF'
# Test File B
Target file for completion testing.
EOF
echo "✅ Created repro.lua"
echo "🧪 MANUAL TEST:"
echo "1. Run: nvim -u repro.lua A.md"
echo "2. Position cursor after 'B' inside [[B]]"
echo "3. Enter insert mode (i)"
echo "4. Press Ctrl-Space to trigger completion"
echo "5. Accept completion and check for duplicate ]]"
echo "Everything installs to ./.repro/ directory"Feel-ix-343
Metadata
Metadata
Assignees
Labels
No labels