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

completion menu issue on neovim #58

Closed
cvlmtg opened this issue Mar 16, 2018 · 7 comments
Closed

completion menu issue on neovim #58

cvlmtg opened this issue Mar 16, 2018 · 7 comments

Comments

@cvlmtg
Copy link
Contributor

cvlmtg commented Mar 16, 2018

with the latest version of asyncomplete (which reintroduced TextChangedP) the completion is working ok, but there's a little issue: If I start typing a word the completion menu appears, but if for some reason I delete a letter (e.g. because I made a mistake) the menu disappear and it doesn't appear anymore unless I erase all the word except the first letter. It doesn't matter if I write another letter, press tab etc. If I want the menu back I have to erase the word up to the first letter. for example:

schermata 2018-03-16 alle 20 03 09

schermata 2018-03-16 alle 20 03 34

schermata 2018-03-16 alle 20 11 17

schermata 2018-03-16 alle 20 11 54

schermata 2018-03-16 alle 20 03 41

I'm using neovim:

NVIM v0.2.3-715-g1d5eec2c6
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20180305-87677-1emzc9v/build/config -I/tmp/neovim-20180305-87677-1emzc9v/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include -I/tmp/neovim-20180305-87677-1emzc9v/build/src/nvim/auto -I/tmp/neovim-20180305-87677-1emzc9v/build/include
Compilato da matteo@mecbucpro.local

Features: +acl +iconv +jemalloc +tui 

this is my config:

let g:asyncomplete_remove_duplicates = 1
let g:lsp_async_completion = 1
let g:lsp_log_file = ''

call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
      \ 'name': 'buffer',
      \ 'whitelist': ['*'],
      \ 'completor': function('asyncomplete#sources#buffer#completor'),
      \ }))

call asyncomplete#register_source(asyncomplete#sources#omni#get_source_options({
      \ 'name': 'omni',
      \ 'whitelist': ['*'],
      \ 'blacklist': ['html', 'javascript', 'javascript.jsx'],
      \ 'completor': function('asyncomplete#sources#omni#completor')
      \  }))

call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
    \ 'name': 'file',
    \ 'priority': 10,
    \ 'whitelist': ['*'],
    \ 'completor': function('asyncomplete#sources#file#completor')
    \ }))

if executable('typescript-language-server')
  call lsp#register_server({
        \ 'name': 'typescript-language-server',
        \ 'priority': 9,
        \ 'cmd': { server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
        \ 'root_uri': { server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_directory(lsp#utils#get_buffer_path(), '.git/..'))},
        \ 'whitelist': ['typescript', 'javascript', 'javascript.jsx']
        \ })
endif

inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
imap <expr> <Space> pumvisible() ? "\<C-y>\<Space>" : "\<Space>"
@prabirshrestha
Copy link
Owner

Could you try reverting this? 720be50

@cvlmtg
Copy link
Contributor Author

cvlmtg commented Mar 17, 2018

it still happens

@prabirshrestha
Copy link
Owner

@cvlmtg try adding this in your vimrc. imap <c-space> <Plug>(asyncomplete_force_refresh)

Then press ctrl+space to force refresh.

@prabirshrestha
Copy link
Owner

I would also suggest you to use au User lsp_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({...})

@cvlmtg
Copy link
Contributor Author

cvlmtg commented Mar 18, 2018

Hi, I did some experiments and I see that the backspace problem is present even if I checkout v1.0, so it seems the problem might not be in the latest changes. I'll try to understand what's going on

@prabirshrestha
Copy link
Owner

The backspace problem was always there. I do plan to fix this in the future but for now you would have to use the mapping as a workaround.

@cvlmtg
Copy link
Contributor Author

cvlmtg commented Mar 18, 2018

ok thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants