Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mime_essence empty with some files #606

Open
pbosab opened this issue Mar 31, 2023 · 1 comment
Open

mime_essence empty with some files #606

pbosab opened this issue Mar 31, 2023 · 1 comment

Comments

@pbosab
Copy link

pbosab commented Mar 31, 2023

Hello,

started using https://github.com/Junker/nuke.xplr and noticed a strange behavior, some simple plain/text files were not recognized and didn't met the regex match.

the file was named "note" made with vim and without extension.

function open of nuke.xplr/init.lua:

local function open(ctx)
    local node = ctx.focused_node
    local node_mime = node.mime_essence

when selecting the "note" file, node_mime is empty.

❯ file -i note
note: text/plain; charset=us-ascii

xplr version: 0.21.1

@sayanarijit
Copy link
Owner

sayanarijit commented Apr 28, 2023

We can probably improve mime detection, but need to be careful about the performance impact. The current library we're using may not be perfect, but is good enough performance-wise. For usecases, where a more precise mime detection is required, it's recommended to use the file command instead of depending on node.mime_essence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants