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

Autocomplete erases text (using CoC) #10

Closed
avahe-kellenberger opened this issue Apr 8, 2021 · 4 comments
Closed

Autocomplete erases text (using CoC) #10

avahe-kellenberger opened this issue Apr 8, 2021 · 4 comments

Comments

@avahe-kellenberger
Copy link

When I press enter to select an autocomplete option,
the text is added then immediately removed.

If I exit to normal mode and undo,
the text is placed back.

This is using the default config for coc-nvim,
following their setup instructions. This does not happen for any other language I've tried with CoC.


If any further info is required please let me know. This makes the plugin almost unusable for me

@clktmr
Copy link
Owner

clktmr commented Apr 8, 2021 via email

@rafaeldelboni
Copy link

I remember having some different behavior from godot lsp and others lsp, probably is their server implementation, but since they will rewrite everything in version 4.0 maybe worth testing with diferent godot versions.

But sorry I don't use godot that much anymore.

@avahe-kellenberger
Copy link
Author

Thanks for the feedback. If this plugin is not the cause we can close the issue, but I'll continue to document my findings here for anyone else who may need it

@clktmr clktmr closed this as completed Apr 8, 2021
@avahe-kellenberger
Copy link
Author

avahe-kellenberger commented Apr 9, 2021

Alright, got it working after some investigation.

I added this to my ~/.config/nvim/after/ftplugin/gdscript3.vim:

inoremap <expr> <CR> complete_info().selected != -1 ?
            \ (coc#expandable() ?  "\<C-y>" : "\<C-y><Esc>a") : "\<C-y>"

Source: godotengine/godot#34523 (comment)

But this didn't seem to resolve it.
I was able to get it working by using the minimal vim config found here: neoclide/coc.nvim#2955

I bisect disabled my vim plugins till I found the culprit to be tmsvg/pear-tree.
I don't know why this is happening, but I've just disabled the plugin for now.

EDIT: let g:pear_tree_ft_disabled = [ "gdscript3" ] will disable this plugin just for this filetype.

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

3 participants