Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
khauchy opened this issue Nov 13, 2023 · 3 comments
Open

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

khauchy opened this issue Nov 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@khauchy
Copy link

khauchy commented Nov 13, 2023

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:

  • when I input [[<C-x><C-o>, the resulting link is [[[[file
  • when I input [](/<C-x><C-o>, the result is [](/[](/path/to/file).

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
Copy link

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
Copy link
Owner

@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.

@artempyanykh artempyanykh changed the title Marksman completion add extra [[ when completing a wiki-link nvim: omni-completion with C-x C-o results in extra braces '[[' Nov 19, 2023
@artempyanykh artempyanykh added the bug Something isn't working label Nov 19, 2023
@serranomorante
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants