artempyanykh / marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.
MIT License
1.98k stars 35 forks source link

nvim: omni-completion with C-x C-o results in extra braces '[[' #263

Open khauchy opened 10 months ago

khauchy commented 10 months ago

I installed the latest Marksman (1.0.0-7f3b471) using snap and use it with nvim.

When I try to insert a wiki-style link, the completion inserts an extraneous [[. For instance:

Have I made a misconfiguration in my configuration, or maybe I am using marksman wrongly?

My nvim version is as follows, and I've also included the minimalist init.vim I use below.

$ nvim --version
NVIM v0.9.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=auto -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include/luv -I/builddir/build/BUILD/neovim-0.9.2/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.9.2/redhat-linux-build/include -I/builddir/build/BUILD/neovim-0.9.2/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.9.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

         fichier vimrc système : "$VIM/sysinit.vim"
               $VIM par défaut : "/usr/share/nvim"

Run :checkhealth for more info
call plug#begin()

Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'neovim/nvim-lspconfig'

call plug#end()

" Lua plugins
lua << EOF
require("mason").setup()
require("mason-lspconfig").setup{
  ensure_installed = {"marksman"},
}

require("lspconfig").marksman.setup{}

EOF
David-Else commented 10 months ago

It works perfectly in Helix out of the box, but I think it is Helix doing the auto pairs functionality. Please don't make any changes without confirming it still works in Helix, thanks.

I press [ and get [] then [ again and get [[]] with the cursor right in the middle with autocompletion working giving me all the links to the files in the workspace.

artempyanykh commented 10 months ago

@khauchy thanks for reporting this. I can reproduce in nvim. I haven't used omni-completion via C-x C-o before however, so I'm not yet sure why it adds extra braces.

I personally use nvim-cmp and TAB completion -- with this setup I don't have any extra braces.

serranomorante commented 5 months ago

Not happening to me. Marksman installed with mason and using omni-completion (which is automatically set by nvim-lspconfig). I'm on nvim nightly btw.

marksman-omnicompletion.webm