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

Wrong filetype detection for files/paths containing "mak", "mk" and possibly some others #77

@nagua

Description

@nagua

Hello everyone,

first off: thank you for your great plugin! It really is a good effort and much easier to read than vimscript.

I'm getting some strange filedetections lately and I wanted to investigate that. The situation:

I created a bash script called 'build_cmake' that uses a shebang at the top of the file.
'filetype.nvim' reports this file as a makefile. I investigated how that could happen and I found that it
matches the complex regex with absolute path check:

if try_regex(absolute_path, complex_maps.complex) then
return
end

This happens to be the case because build_c[mak]e contains the string mak. This could also happen if you have the string mak or mk or dsp in your absolute path. So I would argue that matching on the absolute path should be done after matching a shebang. What do you think about that?

Have a great day!
Nagua

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions