yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.51k stars 203 forks source link

Make best effort to display binary files #500

Open Fuuzetsu opened 10 years ago

Fuuzetsu commented 10 years ago

Currently Yi behaves strangely when trying to open binary files. Here's an image opened in Yi

Yi-binary

As you can see, we have 4 unicode glyphs. Strangely, while only 4 visible characters show, going to the end of the line makes the column counter jump to column 4000. In fact, going to the next line reveals more of the file:

binary line 2

and another line:

binary line 3

And so on.

Yi should make a better effort to display it. Here's (some of) the same file opened in emacs:

emacs binary file

acertain commented 10 years ago

One option is to display the hexdump as Sublime Text does.