micro/internal
Dmytro Maluka 39e410aa46 UpdateRules: reintroduce using header regex for filetype detection
Replacing header patterns with signature patterns was a mistake, since
both are quite different from each other, and both have their uses. In
fact, this caused a serious regression: for such files as shell scripts
without *.sh extension but with #!/bin/sh inside, filetype detection
does not work at all anymore.

Since both header and signature patterns are useful, reintroduce support
for header patterns while keeping support for signature patterns as well
and make both work nicely together.

Also, unlike in the old implementation (before signatures were
introduced), ensure that filename matches take precedence over header
matches, i.e. if there is at least one filename match found, all header
matches are ignored. This makes the behavior more deterministic and
prevents previously observed issues like #2894 and #3054: wrongly
detected filetypes caused by some overly general header patterns.

Precisely, the new behavior is:

1. if there is at least one filename match, use filename matches only
2. if there are no filename matches, use header matches
3. in both cases, try to use signatures to find the best match among
multiple filename or header matches
2024-03-24 04:47:04 +01:00
..
action command: Fix reload command to correctly initialize and reload all runtime files (#3062) 2024-03-22 20:47:30 +01:00
buffer UpdateRules: reintroduce using header regex for filetype detection 2024-03-24 04:47:04 +01:00
clipboard Use zyedidia/clipper for external clipboard 2022-06-14 08:40:57 -04:00
config command: Fix reload command to correctly initialize and reload all runtime files (#3062) 2024-03-22 20:47:30 +01:00
display Highlighting trailing whitespaces 2024-03-14 03:10:31 +01:00
info Add HistorySearchUp and HistorySearchDown actions (#1829) 2023-07-08 14:00:22 -07:00
lua Remove lua.Lock 2024-03-14 04:53:56 +01:00
screen Reset mouse release state after restarting the screen 2023-01-29 18:26:55 +01:00
shell Fix term output capturing 2023-09-08 23:27:39 -07:00
util Highlighting trailing whitespaces 2024-03-14 03:10:31 +01:00
views Add TODO about mysterious behavior of ResizeSplit() 2024-03-14 05:26:34 +01:00