Giter Site home page Giter Site logo

Comments (3)

RaafatTurki avatar RaafatTurki commented on June 20, 2024

Hmm, yes the current binary buffer detection is not too sophisticated (the correct way would be to lookup magic bytes but that's a bit too computationally expensive and requires file streaming for it to be feasible)

As for your issue I believe your files aren't utf8 encoded which trips up hex.nvim into thinking it's binary.

You could disable the utf8 check by setting the following in the configs

  is_file_binary_post_read = function() return false end

from hex.nvim.

bsturk avatar bsturk commented on June 20, 2024

Hi, thanks for that!

Here's what I have now, but unfortunately, it is still happening (commenting it out I can open the file as text, but with all of the below it opens up w/ xxd etc)

{
    'RaafatTurki/hex.nvim',
    config = true,
    is_file_binary_pre_read = function() return false end,
    is_file_binary_post_read = function() return false end
},

I've attached a file which exhibits the issue for me.
rebound.txt

from hex.nvim.

RaafatTurki avatar RaafatTurki commented on June 20, 2024

Ahaa, as I suspected it's not utf8.

You seem to be using lazy to manage your plugins, you should put the options in an opts table like so:

you only need the post_read hook disabled since that's the one that does the utf8 check

{
  'RaafatTurki/hex.nvim',
  config = true,
  opts = {
    is_file_binary_post_read = function() return false end
  }
},

I've tried it on your file and it works.

from hex.nvim.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.