diff options
author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2024-08-01 12:43:42 +0300 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-08-03 14:14:42 +0200 |
commit | 66a74535d40c6b68d38cb92088315fa67dc1304b (patch) | |
tree | f98850c3c5506bac81850065ca02517bccd79de9 /scripts/gen_eval_files.lua | |
parent | eb629cce917155a4d436327db10c8b1b44ae7861 (diff) | |
download | rneovim-66a74535d40c6b68d38cb92088315fa67dc1304b.tar.gz rneovim-66a74535d40c6b68d38cb92088315fa67dc1304b.tar.bz2 rneovim-66a74535d40c6b68d38cb92088315fa67dc1304b.zip |
refactor(filetype): use file name match instead of pattern if possible
Problem: some patterns are used as a replacement for one-two explicit
file matches (like '^[mM]akefile$'). As matching file name directly is
faster and more explicit, it should be preferred.
Solution: move those patterns to direct file name match.
NOTE: this is not strictly backwards compatible, because exact file
name matching is done *before* pattern matching. If user has
conflicting `vim.filetype.add()` call with high priority (like with
`pattern='file$'` and `priority=100`), after this change it will be
ignored (i.e. 'makefile' will match exactly).
Judging by converted cases, it seems reasonable to prefer exact
matches there.
Diffstat (limited to 'scripts/gen_eval_files.lua')
0 files changed, 0 insertions, 0 deletions