nathom / filetype.nvim

A faster version of filetype.vim
560 stars 35 forks source link

Make function_complex work #62

Closed yasuoza closed 2 years ago

yasuoza commented 2 years ago

try_lookup returns true when query is in map even if set_filetype returns false. For that reason, function_literal using try_lookup works.

On the other hand, function_complex using try_regex did not work because set_filetype returns false and try_regex returns false.

This commit resolve the issue by make it always return true when regexp matches the absolute_path. This behavior is consistent with try_lookup.

Conflicts #55 ~but #55 did not work for me~. Sorry #55 worked, but this is backward(explained in README.md) compatibility PR.