hrsh7th/nvim-compe

relative path completion fail if not stating with './'

tkkcc opened this issue · 1 comments

tkkcc commented

In home directory, I type .config/ then tab, but only snippets show. So I have to use <c-x><c-f> for comletion. That is because accept will turn false in following part.

elseif prefix:match('/$') then
local accept = true
-- Ignore URL components
accept = accept and not prefix:match('%a/$')

I also try to insert another condition before last.

  elseif prefix:match('%a/$') then
    -- print(buf_dirname..' '..dirname)
    return vim.fn.resolve(buf_dirname .. '/' ..prefix..'/' ..dirname)
  elseif prefix:match('/$') then

This works for .config/, but '.config/ still fails, and './.config success.

BTW, coc completion works as expected.

tkkcc commented

I don't know why, but it works perfectly now.