Open msva opened 2 years ago
Label: can't understand
As of thing in P.S.
: https://asciinema.org/a/gjJE20ad1di6opgk5YNxgVTmY
And as of the issue itself - unfortunately, I can't just show it (because it is no any visible mark that I pressing <Tab>
) :cry:
I'll try to rephrase:
a) I have following mappings:
["<Tab>"] = cmp.mapping({
c = function()
if cmp.visible() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
else
cmp.complete()
end
end,
i = function(fallback)
if cmp.visible() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
elseif vim.fn["UltiSnips#CanJumpForwards"]() == 1 then
vim.api.nvim_feedkeys(t("<Plug>(ultisnips_jump_forward)"), 'm', true)
else
fallback()
end
end,
}),
['<CR>'] = cmp.mapping({
i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }),
c = function(fallback)
if cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
else
fallback()
end
end
}),
1.a) Also, my current working directory consists of subdirectory files
(with some patches inside) and few files in curent working directory itself. Say, vtk-8.blabla.ebuild
, vtk-9.0.3-r3.ebuild
, and so on.
2) I open neovim to edit one of "ebuilds". Then I want to also open some patch, placed in files
subdirectory of current working dir.
3) So, I type:
:e fil<Tab>
4) completion menu appears
5) there is only "files/
" suggeston available (ok).
6) I press <Tab>
7) it inserts the result to commandline. Now there is :e files/
8) Now I want to navigate over files inside files
directory
9) I press <Tab>
(noticing that cursor is placed after /
)
10) I expect to see completion menu with files from files
directory, but instead, there is still menu with only files/
.
11) only ways to get completion menu with files - is to:
/
and press <Tab>
again, but this will show content of root directory (I mean disk's top level directory, not the /root
) instead of expected content of files/
directory.*
and press <Tab>
, but this leads to #19 So I just want to ask, what is a right things to do in such workflow? :smile_cat:
What happens in 11.
on completing after second /
:
Well, maybe I shouldn't use path
source for c
mode in the first place :man_shrugging:
But then it will only elliminate one part of 11.
. and make this issue be still actual, but in context of cmp-cmdline
The files/
isn't a cmp-path source's result. It's cmp-cmdline issue.
Finally, I understand your problem. I will fix it in cmp-cmdline.
Yeah, files/
itself - is cmdline
's result (and yes, I also missed that until posting a similar comment in #19).
But as you can see on screenshot, somewhy cmp-path
ignores presence of "files/
" and completes files//
like it was a /
:man_shrugging:
Btw, looks like the issue that cmp-path takes multiple trailing slashes as reference to a root dir is still here:
Or is it a feature, and not a bug?
Hi there!
I've faced issue, possibly related to my (probably wrong) workflow, but I don't know how to fix it properly:
I've "path" source enabled in "global" sources (I mean, not for just cmdline). Also I have mappings that uses
behavior = cmp.SelectBehavior.Insert
for<Tab>
,behavior = cmp.SelectBehavior.Select
for<Up>
/<Down>
, andbehavior = cmp.ConfirmBehavior.Replace, select = false
for<CR>
.Meaning "if I'm okay with first suggested variant, I'll just press Tab, and won't bother to navigate anything and pressing Enter, and if it is not - I'll navigate to the appropriate variant and will press Enter on it to replace completion with proper one".
So, when I type
:e fil<Tab>
, and select the appropriate result, I'm getting cmdlne completed to:e files/
. Next I want to navigate files inside it, and sincecmp
doesnt do that by typing<Tab>
once more, I type/
(as I did with deoplete time ago), and then<backspace>
it, to somehow makecmp
know that previous completion stage is over, and I want to complete further. Unfortunately, it still shows onlyfiles/
as only available completion suggestion, and doesn't look inside...And it will only work as expected after selecting proper suggeston (
files/
) with<CR>
So, it looks for me like
cmp-path
is intended to work withInsert
behaviour on<CR>
, and not-inserting over navigation :man_shrugging:P.S. also I hit another variant of #19 while tested things for that issue:
if I type
.
afterfiles/
, and will try to navigate over results, there would be:files/.
,files/..
, andfiles/
. Selecting first two inserts exactly what said, but choosing last one (files/
) insertsfiles/.files/
:man_shrugging: