Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

shebang not work with dotfiles #37

Closed
aspeddro opened this issue Oct 22, 2021 · 4 comments
Closed

shebang not work with dotfiles #37

aspeddro opened this issue Oct 22, 2021 · 4 comments

Comments

@aspeddro
Copy link
Contributor

filetype.nvim no work with .utils

image

:lua print(vim.bo.filetype) return util

Renaming .utils to utils it works.
image

@folliehiyuki
Copy link

According to these the extension is checked first (before shebang), so the filetype for .utils file was set to utils already.

local ext = filename:match("%.(%w+)$")
-- We first check the ones that only require a table lookup
-- because they're the fastest
-- Lookup file extension
if ext then
filetype = map.extensions[ext] or map.function_extensions[ext]
if filetype then
set_filetype(filetype)
return
end
end

@aspeddro
Copy link
Contributor Author

aspeddro commented Oct 22, 2021

here return nil. No exists utils in map.extensions or map.function_extensions

filetype = map.extensions[ext] or map.function_extensions[ext]

here the type is set using filename:

set_filetype(ext)

Maybe analyze_shebang should be analyzed first?

@nathom
Copy link
Owner

nathom commented Oct 22, 2021

This is a bug. It is thinking that utils is an extension, when it is actually the filename.

@nathom
Copy link
Owner

nathom commented Nov 5, 2021

Should be fixed in latest version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants