Closed dunric closed 7 months ago
Ctrl-j works to navigate in the scenario you're describing, not ctrl-y.
Ctrl-j works to navigate in the scenario you're describing, not ctrl-y.
ctrl-y is used to select an entry from a pop-up completion menu. ctrl-j / ctrl-k no longer work, placeholder is misplaced (see the last image).
I misread your description. I thought you were trying to use ctrl-y to navigate after manually entering the first argument.
However, I'm unable to duplicate the problem you're describing.
I noticed that your gopls
is not an official version. Can you update it with :GoUpdateBinaries gopls
?
Also, what version of vim-go are you using? Your bug report says you're using the current version. Does that mean the latest master revision, the latest tagged release, or something else?
I can duplicate what you're describing. I'm not sure what the solution is, though š¤
I think I can fix this in the simple case where the completion text does not contain any placeholders, but it will remain for a case where a completion selection is made that contains placeholders, because Ultisnips does not support nested snippets.
I think I can fix this in the simple case where the completion text does not contain any placeholders, but it will remain for a case where a completion selection is made that contains placeholders, because Ultisnips does not support nested snippets.
Again, thanks for the great job and that you are still keep rolling.
I'd find this solution satisfactory, because placeholders require and rely solely on UltiSnips engine and its features anyway.
Take careā¦
What did you expect to happen?
Using omni-completion should not affect calculation of function arguments placeholders position.
demonstrating example
insertion of![image](https://github.com/fatih/vim-go/assets/1522770/a6ccb73f-8d5e-462e-a6e9-fce45dc21ec8)
string.Contains
function with autofilled placeholdersmanual typing-in of function arguments keeps navigation between placeholders intact, ie. you can still go forth & back with
![image](https://github.com/fatih/vim-go/assets/1522770/4c1b4497-4d9d-41e3-9506-7135ad852890)
Ctrl-j
andCtrl-k
(default keybindings)What happened instead?
Invoking omni completion menu and selection of an entry did broke navigation & selection between placeholders.
use code completion instead of manual typing for the first function's argument![image](https://github.com/fatih/vim-go/assets/1522770/2649276d-85fc-4a76-956a-7af8d0d5dca3)
after selection of the first entry (![image](https://github.com/fatih/vim-go/assets/1522770/3e778564-fa47-40db-8173-8e155a2c5b5f)
message
string variable) withCtrl-y
(default) placeholders got miscalculated and navigation stops working (see invalid placeholder highlight for the first argument)Configuration (MUST fill this out):
vim-go version:
current
vimrc
you used to reproduce:vimrc
```vim let g:go_gopls_use_placeholders = v:true let g:go_snippet_engine = 'ultisnips' ```Vim version (first three lines from
:version
):VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 26 2023 20:39:23)
Go version (
go version
):go version go1.21.4 linux/amd64
gopls version
gopls version
Output:vim-go configuration:
vim-go configuration
filetype detection configuration:
filetype detection