fix: deactivate binary ft detection for Win32 (#1413)

* Make `file` mime type detection for Windows users opt-in, as it caused issues when they had it
This commit is contained in:
fdschmidt93
2021-11-04 07:32:02 +01:00
committed by GitHub
parent 6652d4d555
commit 2097f11305
2 changed files with 4 additions and 3 deletions

View File

@@ -310,7 +310,7 @@ telescope.setup({opts}) *telescope.setup()*
Windows users get `file` from: Windows users get `file` from:
https://github.com/julian-r/file-windows https://github.com/julian-r/file-windows
Set to false to attempt to preview any mime type. Set to false to attempt to preview any mime type.
Default: true Default: true for all OS excl. Windows
- filesize_limit: The maximum file size in MB attempted to be previewed. - filesize_limit: The maximum file size in MB attempted to be previewed.
Set to false to attempt to preview any file size. Set to false to attempt to preview any file size.
Default: 25 Default: 25

View File

@@ -3,6 +3,7 @@ local deprecated = require "telescope.deprecated"
local sorters = require "telescope.sorters" local sorters = require "telescope.sorters"
local if_nil = vim.F.if_nil local if_nil = vim.F.if_nil
local os_sep = require("plenary.path").path.sep local os_sep = require("plenary.path").path.sep
local has_win = vim.fn.has "win32" == 1
-- Keep the values around between reloads -- Keep the values around between reloads
_TelescopeConfigurationValues = _TelescopeConfigurationValues or {} _TelescopeConfigurationValues = _TelescopeConfigurationValues or {}
@@ -411,7 +412,7 @@ append(
append( append(
"preview", "preview",
{ {
check_mime_type = true, check_mime_type = not has_win,
filesize_limit = 25, filesize_limit = 25,
timeout = 250, timeout = 250,
treesitter = true, treesitter = true,
@@ -432,7 +433,7 @@ append(
Windows users get `file` from: Windows users get `file` from:
https://github.com/julian-r/file-windows https://github.com/julian-r/file-windows
Set to false to attempt to preview any mime type. Set to false to attempt to preview any mime type.
Default: true Default: true for all OS excl. Windows
- filesize_limit: The maximum file size in MB attempted to be previewed. - filesize_limit: The maximum file size in MB attempted to be previewed.
Set to false to attempt to preview any file size. Set to false to attempt to preview any file size.
Default: 25 Default: 25