fix(previewer): improve binary mime type check (#3083)

* fix(previewer): improve binary mime type check

Problem: mime type for a ts/js file can either return `text/plain` or
`application/javascript` based on the contents of the file.
Previously, this meant `application/javascript` would be considered
"possibly binary". This, in conjunction with how `vim.filetype.match`
does not give a result for a filename that ends in `.ts`, would lead to
a typescript file taking the path of `check_mime_type` and eventually
`mime_hook`.

Solution: Include `application/javascript` as a non-binary file type
during mime type check.

* [docgen] Update doc/telescope.txt
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
(cherry picked from commit fac83a556e)
This commit is contained in:
James Trew
2024-05-20 11:34:02 +02:00
committed by Simon Hauser
parent 679dacb6f4
commit 588e26ff9f
4 changed files with 25 additions and 9 deletions
+3 -3
View File
@@ -2296,9 +2296,9 @@ utils.transform_path({opts}, {path}) *telescope.utils.transform_path()*
Parameters: ~
{opts} (table) The opts the users passed into the picker. Might
contains a path_display key
{path} (string?) The path that should be formatted
{opts} (table) The opts the users passed into the picker. Might
contains a path_display key
{path} (string|nil) The path that should be formatted
Return: ~
string: The transformed path ready to be displayed