Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

virtual text lose position when using this plugin. #41

Closed
aca opened this issue Jul 6, 2020 · 4 comments
Closed

virtual text lose position when using this plugin. #41

aca opened this issue Jul 6, 2020 · 4 comments

Comments

@aca
Copy link

aca commented Jul 6, 2020

When attaching this plugin, virtual text doesn't follow errors and get lost.

minimal vimrc

call plug#begin('~/.local/share/nvim/plugged')
    Plug 'neovim/nvim-lsp'
    Plug 'nvim-lua/diagnostic-nvim'
    Plug 'nvim-lua/completion-nvim'
call plug#end()
" lua require'nvim_lsp'.gopls.setup{on_attach=require'completion'.on_attach}
lua << EOF
local on_attach_vim = function()
  require'completion'.on_attach()
  require'diagnostic'.on_attach()
end
require'nvim_lsp'.gopls.setup{on_attach=on_attach_vim}
EOF
au Filetype lua setl omnifunc=v:lua.vim.lsp.omnifunc
" Use <Tab> and <S-Tab> to navigate through popup menu
inoremap <expr> <Tab>   pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

" " Set completeopt to have a better completion experience
set completeopt=menuone,noinsert,noselect

let g:diagnostic_enable_virtual_text = 1

let g:completion_chain_complete_list = {
    \ 'default': [
    \    {'complete_items': ['lsp', 'snippet', 'tabnine']},
    \    {'mode': '<c-p>'},
    \    {'mode': '<c-n>'}
    \]
\}

image

@Iron-E
Copy link
Contributor

Iron-E commented Jul 6, 2020

Could this be related to #40?

@aca
Copy link
Author

aca commented Jul 7, 2020

Looks similar.

By the way, even without this plugin.
Virtual text is working well. I thought this plugin was creating virtual text. hmm..

I think I should read the source. 😄

@Iron-E
Copy link
Contributor

Iron-E commented Jul 7, 2020

There are some things that the built-in virtual text function doesn't do (like customizing the prefix, insert delay, etc). I've left more comments on #40 which might help in figuring this out

@aca
Copy link
Author

aca commented Jul 11, 2020

Closing as It seems duplicate issue with #40 .

@aca aca closed this as completed Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants