habamax / vim-godot

Use vim and godot engine to make games

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strange editing problem

loohoo opened this issue · comments

ooo3

after select item and press 'enter' key, it will insert the selected word, but soon the word will be delete automatically

The same is happening to me.
Using neovim v0.4.4,
CoC 0.0.8

vim-godot doesn't do anything with completion, so I would suggest to check your config -- what you have mapped to <CR> ?

For me it looks like both of you have copied some config from coc readme that "enhances" <CR> with some API call which godot language server doesn't support.

PS, I can't reproduce it with YCM and CoC, and I don't have anything from CoC readme in my vimrc.

inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"

inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
			\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

I believe it's one of these two remaps, my guess is that it's the first one.

I have this same issue too.

I'm getting the same issue (Vim 8.0.1568, not Neovim), however I have nothing in my vimrc relating to CoC. As far as I can see, <CR> is not mapped to anything other than the default. So, in theory, it shouldn't be CoC that's the problem, right?

@AlbeyAmakiir well, idk.

But in any case -- vim-godot has nothing to do with it. The plugin is not responsible for autocompetion.

I don't have this issue with ycm and coc so can't even try to help you

Ah, I found this coc-settings.json: https://github.com/rafaeldelboni/dotfiles/blob/299e8a9f32446b272613ff1f133dc0b0db30b2fb/config/nvim/coc-settings.json#L14

So I replaced the default:
"filetypes": ["gdscript"],
With:
"filetypes": ["gd", "gdscript3"],

This change alone seems to have fixed it for me. I don't know why this works, but if that is more correct, perhaps it would at least be worth updating the readme for this project to reflect that? (Again, I'm on Vim, not Neovim, and I don't know if that makes a difference.)

"filetypes": ["gd", "gdscript3"],

These are filetypes that have nothing to do with vim-godot. So you basically do not turn godot lsp for the gdscript filetype this plugin sets up.

image

I was loading the example vim configuration in coc's README from my config script. It works fine after removing it. There's something in that script that triggers the issue. Even if you've not copied any lines from that example config, you can check that you're not doing anything similar in your own config script.

One weird thing I've noticed while testing, if I load the GD file from the command line it works, but if I open the file from inside vim with the "e" command then I can see this problem.

For now it seems to be fixed, although I'm not sure that I haven't removed something that I need from the coc config.

Even if this is not a vim-godot issue I hope we've found a place to cry together and help each other. It's only happened with gdscript files.