towolf / vim-helm

vim syntax for helm templates (yaml + gotmpl + sprig + custom)
Other
203 stars 22 forks source link

Bad compatibility with Oil file explorer #24

Closed Drowze closed 3 months ago

Drowze commented 3 months ago

Oil is an alternative file explorer for Neovim that lets you edit the filesystem inside a normal buffer. The buffer has the type oil and is named oil:///<file path> (or, I believe, oil-ssh:///<file path>, since Oil also has ssh support)

The issue is that since the Oil opens directories in simple buffers, vim-helm calls this function on them (also, I'm not sure why, but findfile("Chart.yaml", expand('%:p:h').';') is always returning something, regardless of the current directory being emtpy. i.e. if I'm on an empty /foo directory and I call findfile("Chart.yaml", expand('%:p:h').';') on it, it will return /foo/Chart.yaml)

Reproducing:

Considering a neovim installation with both Oil.nvim and vim-helm, and an empty directory /Users/foo, when I open that directory with nvim /Users/foo and execute:

:echo findfile("Chart.yaml", expand('%:p:h').';')

I see: Screenshot 2024-05-21 at 10 44 42 (notice the filetype set to helm and the output of the findfile command)

luisdavim commented 3 months ago

can you check https://github.com/towolf/vim-helm/pull/26 ?